我的代码如下所示:
CATransition *transition = [CATransition animation];
transition.duration = duration
我希望得到CATransition / Animation的结束事件。有可能吗?
答案 0 :(得分:26)
CAAnimation(CATransition是其子类)具有您可以使用的委托方法animationDidStop:finished:
。
设置委托属性并实现方法:
CATransition *transition = [CATransition animation];
transition.duration = duration;
transition.delegate = self;
//other settings...
//call addAnimation...
...
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
//do what you need to do when animation ends...
}