Episode #446

Bounce Animation in SwiftUI

18 minutes
Published on July 2, 2020

This video is only available to subscribers. Get access to this video and 527 others.

Simple animations in SwiftUI are refreshingly easy. However, some animations are deceptively tricky, as we don't have access to completion handlers. Animation is entirely state-based, so if we have an animation where an item needs to move and return to its original state, we need to take a different approach. In this episode we will model a bounce animation using a simple sine function, feeding in the time value t using SwiftUI's linear animation interpolation.

This episode uses Xcode 12-beta1, Ios 14.0-beta1.