# Animation by Tutorials - Chapter 14 Gradient Animations

**URL:** <https://forums.kodeco.com/t/animation-by-tutorials-chapter-14-gradient-animations/72391>\
**Category:** iOS Animations by Tutorials\
**Created:** [May 29, 2019, 7:14pm UTC](https://forums.kodeco.com/t/animation-by-tutorials-chapter-14-gradient-animations/72391 "2019-05-29T19:14:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmywilson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jimmywilson/32/81494_2.png) [@jimmywilson](https://forums.kodeco.com/u/jimmywilson)\
**Post date:** [May 29, 2019, 7:14pm UTC](https://forums.kodeco.com/t/animation-by-tutorials-chapter-14-gradient-animations/72391/1 "2019-05-29T19:14:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gdelarosa](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/gdelarosa/32/109063_2.png) [@gdelarosa](https://forums.kodeco.com/u/gdelarosa)\
**Post date:** [May 31, 2019, 2:22pm UTC](https://forums.kodeco.com/t/animation-by-tutorials-chapter-14-gradient-animations/72391/2 "2019-05-31T14:22:22Z")

</div>

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?

Best,  
Gina

---

<div class="post-metadata">

**Author:** ![sgerrard](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/sgerrard/32/93812_2.png) [@sgerrard](https://forums.kodeco.com/u/sgerrard)\
**Post date:** [June 1, 2019, 9:53pm UTC](https://forums.kodeco.com/t/animation-by-tutorials-chapter-14-gradient-animations/72391/3 "2019-06-01T21:53:13Z")

</div>

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:

```auto
    gradientAnimation.isRemovedOnCompletion = false

```

That’s all it takes!

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [November 12, 2019, 11:14am UTC](https://forums.kodeco.com/t/animation-by-tutorials-chapter-14-gradient-animations/72391/4 "2019-11-12T11:14:32Z")

</div>

Closed on November 12, 2019, 11:14am UTC

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