๐Ÿ”ธ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 di๏ฌ€erent values during an animation, we can add log statements to the setter of animatableData or the body method of the animatable modi๏ฌer.

Last updated