How to find out when coreanimation animation ends

I am doing an animation with the main animation, but I can’t find a way to find out with a notification or event when the animation block is finished, for example, in the UIVIew animation block you have

setAnimationDidStopSelector:

how can i find out in the main animation, thanks for any help

+3
source share
1 answer

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

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

In the above example, yourDelegatemust implement a method animationDidStop:finished:in order to be able to detect the end of the animation.

+7
source

Source: https://habr.com/ru/post/1712640/


All Articles