所以,
我使用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;
这样的方法,以便我可以知道动画何时完成?
我想在动画完全结束后立即运行一个方法。有什么想法吗?
答案 0 :(得分:9)
答案 1 :(得分:0)
我使用类别来创建这样的方法:
[group setCompletionBlock:^{
}];
请在此处查看我的回答:https://stackoverflow.com/a/28051909/1485701