我动画停止后,我使用以下代码调用方法
[UIView beginAnimations:@"swipe" context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)];
[UIView setAnimationDuration:0.3f];
//My Animation
[UIView commitAnimations];
这是transitionDidStop方法的签名
- (void)transitionDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
但我注意到即使在转换停止后也永远不会调用该方法。那是为什么?
答案 0 :(得分:1)
因为你需要
- (void)transitionDidStop:(NSString *)animationID finished:(BOOL)finished context:(void *)context
方法
但你有
- (void)transitionDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context