Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an way to pause an Core Animation and resume it at some time later?

I have several Core Animation's going on at the same time. They all have an context and an animation id, where the context is the object that's beeing animated (UIImageView objects). I would like to pause them, so that the animation just stops temporarily, and then when some things are done, resume it to complete it. These things happen only on very fast scroll movements in an UIScrollView. I want to improve performance by stopping all ongoing animations but not the one that makes the scroll view scroll. I have implemented an custom animation of the contentOffset for that scroll view.

like image 414
Thanks Avatar asked May 30 '09 15:05

Thanks


2 Answers

You can pause layer animations by setting the speed of the animation to zero, see How to pause the animation of a layer tree.

like image 124
Douglas Avatar answered Oct 02 '22 23:10

Douglas


To anyone who comes searching, this is how you pause and resume animations:

https://developer.apple.com/library/archive/qa/qa1673/_index.html

like image 27
Dermot Avatar answered Oct 02 '22 23:10

Dermot