swiftui-motion
Installation
SKILL.md
SwiftUI Motion
SwiftUI animation core. Loaded for any SwiftUI project (iOS, macOS, multi-target Apple). Concise rules here. Deep-dive in
references/. Pair with../motion-principles/SKILL.md(foundation) and../mobile-principles/SKILL.md(touch UX).
Animation API decision tree
| Need | API |
|---|---|
| Single value over time | withAnimation { } + @State or .animation(_, value:) |
| Multiple coordinated states | PhaseAnimator(phases) (iOS 17+) |
| Time-based keyframes | KeyframeAnimator(initialValue:repeating:content:) (iOS 17+) |
| Custom property animations | @Animatable macro (iOS 26+) or Animatable protocol (iOS 13+) |
| Shared element transitions | matchedGeometryEffect(id:in:) |
| Gesture-driven | DragGesture / MagnifyGesture + .offset / .scaleEffect |
| Loop forever | .animation(.linear.repeatForever(autoreverses: true), value: ...) or .phaseAnimator |