Back to Developer Roadmap

Animatable Protocol

src/data/roadmaps/swift-ui/content/[email protected]

4.01.0 KB
Original Source

Animatable Protocol

The Animatable protocol allows you to customize how changes to your custom data types are animated in SwiftUI. By conforming to this protocol, you define a var animatableData: Self.AnimatableData property that SwiftUI uses to interpolate between the starting and ending values of your data during an animation. This enables smooth transitions for properties that aren't directly animatable by default, giving you fine-grained control over animation behavior.

Visit the following resources to learn more: