Member-only story

Chain Animations in Swift

One animation after another

Steven Curtis
4 min readMay 29, 2020
Photo by JJ Ying on Unsplash

Anyone who has use animations in Swift will have become (possibly unwillingly) familar with an animation pyramid. Look further for both an example of this, and how you can avoid being another pyramid victim.

Difficulty: Beginner | Easy | Normal | Challenging

Prerequisites:

Terminology

UIView: An object that manages the content for a rectangular area on the screen

The challenge

You might well have dabbled with animations in Swift. Good for you! They are fun, and we can see a problem developing if we start to chain animations using animateWithDuration:animations:completion:

Click for Gist

it’s a mess! This could be a pyramid of DOOM.

This isn’t a fully working example, so this article will take us through a simple animation and how…

--

--

No responses yet