Chapter 21: Challenge Bug?

The “Show More”/“Show Less” button animation is not working properly.

To make it work we have to make the following changes:

Replace this line of code:

toggleHeightAnimator.pauseAnimation()

with this:

toggleHeightAnimator.stopAnimation(true)

and this line of code:

toggleHeightAnimator.continueAnimation(withTimingParameters: nil, durationFactor: 1.0)

with this:

toggleHeightAnimator.startAnimation()

The changes above produce the exact same results and additionally eliminate the bug.

So, what is the point in using pauseAnimation and continueAnimation?

@icanzilb Do you have any feedback regarding this? Thank you - much appreciated! :]