Retrieve the CAKeyframeAnimationKey's key in AnimationDidStop

Posted by JacktheSparrow on Stack Overflow See other posts from Stack Overflow or by JacktheSparrow
Published on 2011-11-30T01:02:24Z Indexed on 2011/11/30 1:50 UTC
Read the original article Hit count: 301

I have multiple CAKeyframeAnimation objects, each with a unique key like the following:

 .....
 [myAnimation setValues:images];
 [myAnimation setDuration:1];
 ....
 [myLayer addAnimation:myAnimation forKey:@"unique key"];

My question is, if I have multiple animation like this and each with a unique key, how do I retrieve their keys in the method AnimationDidStop? I want to be able to do something like this:

 -(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:
 }
 }

© Stack Overflow or respective owner

Related posts about ios

Related posts about core-animation