Animation skill · Mobile

SwiftUI motion

Springs, matched geometry, keyframes and haptics on iOS.

Give this skill to your AI agent

Run this in your project. Claude Code picks it up from .claude/skills; for other agents, paste the file into their rules.

mkdir -p .claude/skills/swiftui-motion && curl -fsSL https://kitesmotion.com/skills/swiftui-motion/SKILL.md -o .claude/skills/swiftui-motion/SKILL.md
Download SKILL.md

Use SwiftUI's built-in animation system first; it is interruptible and handles accessibility.

Defaults

  • withAnimation(.snappy) for quick state changes.
  • .smooth for layout changes, .bouncy sparingly.
  • Custom: .spring(response: 0.35, dampingFraction: 0.85).

Shared elements

swift@Namespace private var ns
CardView().matchedGeometryEffect(id: item.id, in: ns)

Use the same id in both states and wrap the state change in withAnimation.

Multi-step animations

  • PhaseAnimator for simple loops through states.
  • KeyframeAnimator for timed tracks (scale, rotation, offset) like a bounce or shake.

Transitions

  • .transition(.move(edge: .bottom).combined(with: .opacity)) for sheets and toasts.
  • .contentTransition(.numericText()) for numbers.
  • .symbolEffect(.bounce, value: count) and .contentTransition(.symbolEffect(.replace)) for SF Symbols.

Scroll

  • .scrollTransition { content, phase in content.scaleEffect(phase.isIdentity ? 1 : 0.92).opacity(phase.isIdentity ? 1 : 0.6) }
  • .scrollTargetBehavior(.viewAligned) for paging carousels.

Haptics

.sensoryFeedback(.selection, trigger: value), .success on completion, .impact(weight: .light) on snaps.

Performance

  • Use .drawingGroup() for heavy layered drawing.
  • Use Canvas with TimelineView(.animation) for particles.
  • Avoid animating frame on large lists; animate offset and scaleEffect.

Accessibility

Read accessibilityReduceMotion and fall back to opacity changes.

More skills