Animated effect ios
Usually animations are used for B2C or gaming apps. At W2S Solutions, we built an enterprise iPhone app with an animated progress icon. This represents a particular action is initiated and can be controlled by pressing Stop, Start and Reset buttons. Its similar like iOS alarm clock implementation and we believe its not yet implemented in any other apps so far.
Pausing and Resuming an animation
timer resume Creating an key frame animation:

CAKeyframeAnimation* moveAnimation = [CAKeyframeAnimation animationWithKeyPath:@”position”];
moveAnimation.duration = 03.0f;
moveAnimation.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.width) cornerRadius:self.frame.size.width/2].CGPath;
moveAnimation.rotationMode = kCAAnimationRotateAuto;
moveAnimation.calculationMode = kCAAnimationCubicPaced;
moveAnimation.removedOnCompletion = NO;
moveAnimation.repeatCount = HUGE_VALF;
[indicatorView.layer addAnimation:moveAnimation forKey:@”position”];

To Pause:
To pause and resume an animation, the key idea is to use timing of an animation i.e CAMediaTiming protocol for the view layer. By using speed and timeoffset property of layer, we can control the animation timing.

CFTimeIntervalpausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
layer.speed = 0.0;
layer.timeOffset = pausedTime;

To Resume:

CFTimeIntervalpausedTime = [layer timeOffset];
layer.speed = 1.0;
layer.timeOffset = 0.0;
layer.beginTime = 0.0;
CFTimeIntervaltimeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] – pausedTime;
layer.beginTime = timeSincePause;

Reference:

http://www.objc.io/issues/12-animations/animations-explained/
http://ronnqvi.st/controlling-animation-timing/


Happy coding. If you have any iOS or Mobile app queries, please reach us at W2S Solutions.com or email us at sales@W2SSolutions.com

       NO.1, 1ST FLOOR, MRK ARCADE,
       200 FEET RADIAL ROAD, THORAIPAKKAM,
CHENNAI, INDIA - 600097.
PH: +91 44-6050 6059


9820 IVALENES HOPE DR,
AUSTIN TX 78717.
PH: +1 630 299 7737


5838 BURBANK ROAD SE, CALGARY,
ALBERTA, CANADA T2H 1Z3
PH: +1 403 926 3660