Group Group Group Group Group Group Group Group Group

Chapter 21: Challenge Bug?

#1

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?

#2

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

opened #4