所以,
我使用CABasicAnimation
执行一个简单的动画(如下所示)。
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
是否有类似
-(BOOL) isAnimationCompleted;
的方法,这样我才能知道动画何时完成?我想在动画结束后立即运行一个方法。有任何想法吗 ?
最佳答案
实现方法
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
您可以从here查看文档。