Core animation stops working after app goes to the background once

I have an app, which uses Core Animation with explicit and manual timing. I set the speed of a CALayer to zero, and set timeOffset based on user's activity (touch position).


The application works fine as long as it stays in the foreground, but this animation stops working when I presses the Home button, then, reactivate the application.


If I recreate all the views and layers again, everything starts working again. It seems that the system is doing something to my views and layers, when it put the app in the background and restored.

Replies

So the app isn't responding to the user's touch after your app is sent to the background and is brought back? You've verified that your tracking code is working correctly, right?

When your application goes into the background, all animations are removed from all layers. You will have to re-establish these animations each time you come to the foreground.