I know you have to use this method to get the delegate method for when the animation has finished:
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag {
The problem is, how would I distinguish between multiple CAAnimations like 2 or more?
I googled this and I haven't found anything useful.
Please share with me on how you accomplished this!
Thanks!
A
CAAnimation
object is supposed to be reused from time to time and that's why I don't like to give it a certain key (since it's not unique). What makes it unique is the association with a CALayer withaddAnimation:forKey:
. For this reason I use the following code inanimationDidStop
:You can set key/value objects for CAAnimation instance like this:
Check which one was called in delegate method: