How to identify CAAnimation within the animationDidStop delegate?

后端 未结 10 2178
梦毁少年i
梦毁少年i 2020-11-28 18:26

I had a problem where I had a series of overlapping CATransition / CAAnimation sequences, all of which I needed to perform custom operations when the animations stopped, but

10条回答
  •  攒了一身酷
    2020-11-28 18:46

    The second approach will only work if you explicitly set your animation to not be removed on completion before running it:

    CAAnimation *anim = ...
    anim.removedOnCompletion = NO;
    

    If you fail to do so, your animation will get removed before when it completes, and the callback will not find it in the dictionary.

提交回复
热议问题