开发者

CAKeyframeAnimation on complete

开发者 https://www.devze.com 2023-02-20 15:53 出处:网络
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?

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,

Tee


You 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
0

精彩评论

暂无评论...
验证码 换一张
取 消