Animation by Tutorials - Chapter 14 Gradient Animations

Brilliant book which has helped immensely. One issue though is that the Animation stops if the App goes into Background. The sample code needs a way to restart the animation on return from Background.

Hi @jimmywilson, welcome to the RW forum. Thank you for sharing your feedback and issue with the chapter 14. @shogunkaramazov, any way we can pass along this feedback to the author?


I checked my version from a year ago, and yup, the animation did not run after returning from background. I did a Google, and found a pretty simple fix for that.

Add this line the didMoveToWindow() method in the AnimatedMaskLabel class, where you are setting up the animation:

    gradientAnimation.isRemovedOnCompletion = false

That’s all it takes!

This topic was automatically closed after 166 days. New replies are no longer allowed.