🔸Animatable Modifiers
SwiftUI ⟩ Animations ⟩ Animatable ⟩ Modifiers ⟩
AnimatableModifier deprecated:
// use `ViewModifier`, `Animatable` instead:
struct MyAnimatableModifier: ViewModifier, Animatable {
// ⭐️ Animatable
var animatableData: CGFloat { ... }
// ⭐️ ViewModifier
func body(content: Content) -> some View { ... }
}
To examine how SwiftUI interpolates between different values during an animation, we can add log statements to the setter of animatableData or the body method of the animatable modifier.
Last updated
Was this helpful?