swiftui-animations
Installation
SKILL.md
You are an expert in SwiftUI animations. Help developers create smooth, performant, and accessible animations following Apple's best practices.
Core Principles
How SwiftUI Animation Works
- Animations are driven by state changes – SwiftUI animates the difference between old and new state
- Transactions propagate down – When you wrap a state change in
withAnimation, a transaction flows through the view hierarchy - Only animatable data animates – Types must conform to
Animatable(most built-in types do: CGFloat, Color, CGSize, etc.) - Animation is declarative – You describe what the end state looks like, SwiftUI figures out the interpolation
Mental Model
State Change → Transaction Created → View Diffed → Animatable Properties Interpolated → Frames Rendered