So,
I perform a simple animation with CABasicAnimation
(as shown below).
CAAnimationGroup *theGroup = [CAAnimationGroup animation];
theGroup.fillMode = kCAFillModeForwards;
theGroup.removedOnCompletion = NO;
theGroup.delegate = self;
theGroup.timingFunction =[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
theGroup.duration = inDuration;
theGroup.repeatCount = 0;
theGroup.animations = [NSArray arrayWithObjects:rotationZ, theAnimationX, theAnimationY, nil]; // you can add more
[inLayer addAnimation:theGroup forKey:@"animateLayer"];
NSLog (@"ABCD");
// This gets called before end of animation
Is there any method like -(BOOL) isAnimationCompleted;
so that I could know when animation is completed ?
I want to run a method right after animation has come to a complete end . Any ideas ?
The animationend event is fired when a CSS Animation has completed. If the animation aborts before reaching completion, such as if the element is removed from the DOM or the animation is removed from the element, the animationend event is not fired.
The animation-iteration-count CSS property sets the number of times an animation sequence should be played before stopping.
infinite. If assigned an animation-iteration-count value of infinite, the animation will repeat infinitely. This is the best value for an animation that you don't want stopping on its own.
Implement the method
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
which you can see the doc from here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With