Contents

animatableData

The data to animate.

Declaration

var animatableData: Self.AnimatableData { get set }

Discussion

SwiftUI reads this property to capture the current vector representation of the animatable state, and writes it back on each animation frame with an interpolated value. The default implementation returns EmptyAnimatableData, meaning nothing is animated.

Use the Animatable() macro to synthesize this property automatically. Implement it by hand only when you need custom interpolation logic such as clamping, normalization, or mapping to a derived value.

See Also

Animating data