in Core Animation, Objective-C, Programming, UIKit

Core Animation stops animation on app relaunch

On one of my projects I discovered a bug in a never-ending animation I had set up. Whenever the app was suspended (such as when you multitask and open another app), on relaunching the app the animation was frozen. After some investigating, I discovered that with Core Animation you need to set a flag on the CABasicAnimation class called removedOnCompletion to NO otherwise the animation will get cleaned up when it gets suspended.

Does this seem like a bug or a feature?

Write a Comment

Comment

  1. Thank you so much, every other answer I’ve seen for this problem has been totally ridiculous. This is such a simple fix.