CAKeyframeAnimation on complete
I have several CAKeyframeAnimation objects in my class.
They all have self as the delegate.In my animationDidStop function, how can I tell where the call is coming from?
Is there any variable I can pass to CAKeyfameAnimation like an animationID or something?Tha开发者_如何学Gonks,
TeeYou can use Key-Value coding to set values for arbitrary keys (keys need not be defined in advance) for a CAAnimation object.
For example, you can set a value for a key @"tag" for each CAAnimation object as the following:
CAAnimation oneOfYourAnimations = [CAAnimation animation];
[oneOfYourAnimations setValue:@"dropAnimation" forKey:@"tag"];
Later, you can read the value of each object as the following:
[anAnimation valueForKey:@"tag"]; //will return @"dropAnimation" if it's the previous animation
精彩评论