移动开发

swiftui-motion

athevon/genjutsu

SwiftUI animation foundations - withAnimation, transitions, matchedGeometryEffect, PhaseAnimator, KeyframeAnimator, springs, gestures.

  • 945 次安装
  • 701 星标
  • 收录于

安装命令

npx skills add https://github.com/athevon/genjutsu --skill swiftui-motion

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