iphone动画结束问题
定义2个动画
-(CAKeyframeAnimation *)moveanimation
{
CGMutablePathRef path=CGPathCreateMutable();
CGPathMoveToPoint(path, NULL,0,0);
CGPathAddQuadCurveToPoint(path,NULL, 100, 100, 0, 100);
CGPathCloseSubpath(path);
CAKeyframeAnimation *animation=[CAKeyframeAnimation animationWithKeyPath:@"position"];
animation.duration=4.0f;
animation.path=path;
animation.calculationMode=kCAAnimationCubicPaced;
animation.delegate=self;
CFRelease(path);
return animation;
}
-(CAKeyframeAnimation *)movestraight
{
CGMutablePathRef path=CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, 0, 0);
CGPathAddLineToPoint(path, NULL, 100, 100);
CGPathAddLineToPoint(path, NULL, 0, 100);
CAKeyframeAnimation *animation=[CAKeyframeAnimation animationWithKeyPath:@"position"];
animation.delegate=self;
animation.duration=4.0f;
animation.path=path;
animation.fillMode=kCAFillModeForwards;
animation.removedOnCompletion=NO;
CFRelease(path);
return animation;
}
分别调用他们
[imageView.layer addAnimation:[self movestraight] forKey:@"123"];
[imageView.layer addAnimation:[self moveanimation] forKey:@"234"];
如何再
-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
NSLog(@"123");
}中判断是哪个动画结束了。求详细教育