I have three animations. But I want to play these respectively, not at the same time. All of animations are instance of CABasicAnimation
. How can i achieve this ?
Thanks.
I have three animations. But I want to play these respectively, not at the same time. All of animations are instance of CABasicAnimation
. How can i achieve this ?
Thanks.
A CABasicAnimation
is a subclass of CAAnimation
. CAAnimation
has a delegate
property. This delegate is called with
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
when one animation did stop (either forced or finished).
So set your CABasicAnimation
delegate and implement the animationDidStop:finished:
delegate method, check that the animation has finished
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
if (theAnimation == myFirstAnimation)
if (flag)
{}
}
}
}
and you are good to go.