我有多个 CAKeyframeAnimation 对象,每个对象都有一个唯一的键,如下所示:
.....
[myAnimation setValues:images];
[myAnimation setDuration:1];
....
[myLayer addAnimation:myAnimation forKey:@"unique key"];
我的问题是,如果我有多个这样的动画并且每个动画都有一个唯一的键,我如何在 AnimationDidStop 方法中检索它们的键?我希望能够做这样的事情:
-(void)animationDidStop:(CAAnimation*)animation finished:(BOOL)flag{
if(..... ==@"uniquekey1"){
//code to handle this specific animation here:
}else if(.... ==@"uiquekey2"){
//code to handle this specific animation here:
}
}