dot-skills iOS SwiftUI Animations Best Practices
Comprehensive animation guidelines for SwiftUI apps, designed to produce fluid, native-feeling motion that matches Apple's first-party quality. Contains 47 rules across 8 categories, prioritized by impact — from spring physics fundamentals to orchestration polish.
When to Apply
Reference these guidelines when:
- Adding animations to SwiftUI views or transitions
- Building gesture-driven interactions (drag, swipe, pan)
- Connecting views with spatial transitions (expand/collapse, navigation morphs)
- Designing micro-interactions (button press, toggle, loading states)
- Making content changes feel physical (number rolls, symbol replacements)
- Choreographing multi-element animation sequences
- Reviewing animation code for performance and accessibility
Rule Categories by Priority
| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Spring Physics | CRITICAL | spring- | 7 |
| 2 | Timing & Feel | CRITICAL | feel- | 6 |
| 3 | Gesture Continuity | HIGH | gesture- | 7 |
| 4 | Spatial Transitions | HIGH | spatial- | 6 |
| 5 | Micro-interactions | HIGH | micro- | 6 |
| 6 | Content Motion | MEDIUM-HIGH | content- | 5 |
| 7 | Orchestration | MEDIUM | orch- | 5 |
| 8 | Craft & Polish | MEDIUM | craft- | 5 |
Quick Reference
1. Spring Physics (CRITICAL)
spring-smooth-default— Default to .smooth spring for all UI transitionsspring-snappy-responsive— Use .snappy spring for responsive interactionsspring-bouncy-celebration— Use .bouncy spring for playful and celebratory momentsspring-custom-parameters— Tune custom springs with response and dampingFractionspring-velocity-preservation— Springs preserve velocity on interruptionspring-never-linear— Never use linear or easeInOut for interactive UIspring-completion-chaining— Use withAnimation completion for chained sequences
2. Timing & Feel (CRITICAL)
feel-250ms-max— Keep UI animations under 250msfeel-faster-better— Faster animations almost always feel betterfeel-asymmetric-enter-exit— Use asymmetric timing for enter and exitfeel-distance-proportional— Match duration to distance traveledfeel-haptic-sync— Sync haptic feedback to visual animation keyframesfeel-stagger-timing— Stagger reveals at 30-50ms intervals
3. Gesture Continuity (HIGH)
gesture-rubber-band— Rubber band at drag boundariesgesture-momentum-dismiss— Dismiss on velocity OR distance thresholdgesture-snap-points— Use velocity-aware snap pointsgesture-interruptible— Make all gesture animations interruptiblegesture-scroll-drag-conflict— Resolve scroll and drag gesture conflictsgesture-state-transient— Use GestureState for transient drag stategesture-projected-landing— Project gesture velocity for natural landing position
4. Spatial Transitions (HIGH)
spatial-matched-geometry— Use matchedGeometryEffect for expand/collapse morphsspatial-zoom-navigation— Use zoom navigation transition for collection detail (iOS 18)spatial-transition-origin— Anchor transitions to their trigger locationspatial-hero-shared-element— Share multiple element IDs for rich hero animationsspatial-sheet-morph— Use matchedGeometryEffect for sheet presentationsspatial-tab-continuity— Maintain spatial direction in tab transitions
5. Micro-interactions (HIGH)
micro-button-press-scale— Scale buttons to 0.97 on press for tactile feedbackmicro-haptic-pairing— Pair every visual state change with haptic feedbackmicro-symbol-effect— Use symbolEffect for SF Symbol animationsmicro-toggle-bounce— Add bounce to toggle state changesmicro-long-press-fill— Animate progressive fill for long press actionsmicro-loading-phase— Use repeating spring for organic loading states
6. Content Motion (MEDIUM-HIGH)
content-numeric-text— Use contentTransition(.numericText) for number changescontent-scroll-transition— Use scrollTransition for scroll-position effectscontent-visual-effect— Use visualEffect for position-aware animationscontent-symbol-replace— Animate symbol replacement with contentTransitioncontent-text-renderer— Use Text Renderer for character-level animation (iOS 18)
7. Orchestration (MEDIUM)
orch-phase-animator— Use PhaseAnimator for multi-step sequencesorch-keyframe-animator— Use KeyframeAnimator for timeline-precise motionorch-stagger-children— Stagger child elements for orchestrated revealsorch-coordinated-entrance— Coordinate multi-element entrances with shared triggerorch-timeline-view— Use TimelineView for continuous repeating animations
8. Craft & Polish (MEDIUM)
craft-reduce-motion— Respect accessibilityReduceMotion with crossfade fallbackcraft-blur-bridge— Use blur to bridge imperfect transition statescraft-drawing-group— Use drawingGroup() for Metal-backed complex animationscraft-geometry-group— Use geometryGroup() to isolate layout animation propagationcraft-transaction-debug— Use Transaction to debug and override animation behavior
How to Use
Read individual reference files for detailed explanations with incorrect/correct code examples:
- Section definitions — Category structure and impact levels
- Rule template — Template for adding new rules
Reference Files
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
