views:

279

answers:

1

Hi, I'm doing some animations with core animation, but I can't found a way to know with a notification or event when the animation block has finish, like in UIVIew animation block you have

setAnimationDidStopSelector:

how can I know this in core animation, thanks for any help

+1  A: 

If you are using a CAAnimation instance, look at the animationDidStop:finished: for its delegate.

CAAnimation * animation = [CAAnimation animation];
animation.delegate = yourDelegate; // could be self, for example.
[yourLayer setAnimation:animation forKey:nil];

In the example above, yourDelegate should implement the animationDidStop:finished: method to be able to detect the animation end.

Marco Mustapic