/ios-swift-skills:ios-animation-graphics-skillfrom ios-swift-skills
Designs, implements, debugs, and reviews accessible Apple-platform animation and graphics using SwiftUI, Core Animation, and Lottie. Covers motion design, custom drawing, transitions, particles, and performance.
Ships in ios-swift-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Choose the simplest rendering system that expresses the motion, then make accessibility and lifecycle behavior part of the design rather than a later patch.
Canvas and TimelineView require iOS 15, macOS 12, tvOS 15, or watchOS 8.matchedGeometryEffect requires iOS 14 / macOS 11.PhaseAnimator, KeyframeAnimator, and the first symbol-effect APIs require iOS 17 / macOS 14.LottieView was introduced in Lottie 4.3. Pin a tested package version and obey that release’s Xcode, Swift, and deployment requirements; Lottie 4.6 requires Xcode 16 / Swift 6.#available and provide a meaningful lower-target result. Treat 27-cycle APIs as unavailable unless the project actually builds with that SDK.State the exact minimum that the proposed implementation needs; do not assign one minimum to every animation technique.
| Need | Preferred tool |
|---|---|
| Animate SwiftUI state, layout, or transitions | withAnimation, value-scoped .animation, transition |
| Several discrete or timed phases | PhaseAnimator / KeyframeAnimator on iOS 17+ |
| Draw many lightweight vector elements | Canvas |
| Redraw continuously from elapsed time | TimelineView(.animation) around Canvas |
| Synchronize two SwiftUI layouts | matchedGeometryEffect |
| Animate an SF Symbol | symbolEffect where available |
| Control a layer tree or UIKit view | Core Animation / UIViewRepresentable |
Play designer-authored JSON or .lottie assets | Lottie |
Do not drive a Canvas by changing a captured scalar with withAnimation; a renderer closure is not itself animatable data. Derive each frame from a TimelineView date or expose explicit animatable values in a custom view.
.animation(_:value:).withAnimation for an explicit state mutation.@Environment(\.accessibilityReduceMotion) private var reduceMotion
@State private var isExpanded = false
Button("Details") {
withAnimation(reduceMotion ? nil : .snappy) {
isExpanded.toggle()
}
}
.scaleEffect(isExpanded ? 1.08 : 1)
.opacity(isExpanded ? 1 : 0.85)
For multi-stage motion on iOS 17+, prefer phase or keyframe animators over chains of delayed tasks. Provide a simple state change for earlier targets.
Canvas redraws when its surrounding view invalidates. For time-based graphics, wrap it in TimelineView(.animation(paused:)) and derive phase from context.date. Pause the schedule for Reduce Motion and when the animation is not visible or active.
Read examples/example_canvas_waveform.swift for a complete iOS 15+ waveform. It uses time as the source of truth, has no accumulating phase drift, and renders a static frame for Reduce Motion.
Control work per frame:
TimelineView cadence and pause offscreen work.Layer geometry is invalid in makeUIView when the host view still has zero bounds. Put layer sizing and mask paths in a UIView subclass’s layoutSubviews; disable implicit actions for those layout updates. Make playback updates idempotent and never force-unwrap a stored animation.
Read examples/example_gradient_border.swift for a layout-safe, Reduce-Motion-aware border. Use the same pattern for emitter layers: update frame and emitterPosition from current bounds, set birthRate to zero when paused/reduced/offscreen, and remove animations during teardown.
Use Lottie’s native SwiftUI LottieView on Lottie 4.3+; do not create local types named LottieView or LottieAnimationView. Those names collide with library types and can make state declarations recursively refer to the wrong type.
Keep playback declarative with LottiePlaybackMode. For Reduce Motion, show a meaningful static progress frame or an asset-authored reduced-motion marker rather than autoplaying. Verify the animation asset exists in the intended bundle and test VoiceOver focus while it plays.
Read examples/example_lottie_animation.swift after adding a compatible Lottie package. The example intentionally has an external dependency and is not part of dependency-free compiler validation.
accessibilityReduceMotion in every view that autoplays, loops, travels, parallax-scrolls, or emits particles.What SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/app-intents-widgetsDesign, implement, debug, and verify stable App Intents and WidgetKit integrations, including AppIntent, AppEntity, AppEnum, entity queries, AppShortcutsProvider, dependency injection, shared extension data, widget timelines, relevance, controls, Live Activity selection, deep links, handoff, confirmation, and privacy. Use when exposing app actions to Siri or Shortcuts, building configurable or interactive widgets, sharing state with extensions, or choosing the correct system surface for an action. Do not use for ordinary in-app buttons, generic SwiftUI layout, background scheduling without a widget or intent, SiriKit-only legacy work with no migration request, or Live Activity push-server implementation as the sole task./apple-evaluationsBuild, review, and debug generative AI quality regression suites with Apple's Evaluations framework, including Evaluation, datasets, metrics, Swift Testing integration, calibrated model judges, and tool-call trajectories. Use when measuring an Apple-platform intelligence feature, comparing prompts or models, or diagnosing misleading evaluation results. Do not use for ordinary deterministic unit tests, UI automation, performance profiling alone, model training, or an unrelated vendor's evaluation framework./cross-platform-app-development-skillUse when one Swift/SwiftUI product intentionally targets two or more of iOS, iPadOS, Mac Catalyst, macOS, watchOS, tvOS, or visionOS and needs shared-domain design, adaptive UI, capability boundaries, navigation, input, scenes, storage, or conditional compilation. Do not use for a single-platform feature or for non-Apple cross-platform frameworks./ios-accessibility-skillUse when iOS or iPadOS accessibility design, implementation, review, or testing involves VoiceOver, Voice Control, Switch Control, Full Keyboard Access, Dynamic Type, contrast, motion, focus, media alternatives, or Assistive Access. Do not use for generic visual styling or platform-neutral UI work with no accessibility requirement./iphone-duo-designUse when designing, adapting, implementing, or auditing an iOS app for iPhone Duo, including resizing, folding, vertical bars, reserved regions, state continuity, multiple scenes, camera behavior, and accessibility. Produce evidence-based readiness findings with SDK gates and fallbacks. Do not use for generic iPhone work without Duo or adaptive-layout requirements, Android foldables, Microsoft Surface Duo, Google Duo, or claims of Apple certification./memory-leak-diagnosis-skillDiagnose, explain, and fix Swift and Apple-platform memory leaks, unexpected object retention, deinit failures, heap growth, retain cycles, runaway caches, task and AsyncSequence lifetimes, timer/delegate/closure ownership, jetsam, and ARC issues using Xcode Memory Graph and Instruments Allocations, Leaks, and VM tools. Use when objects do not deallocate, memory rises across repeated workflows, or weak/unowned and capture-list choices are unclear. Do not enable Zombies for leak measurement, call every temporary retention a leak, or use unowned without a proven lifetime invariant.npx claudepluginhub fal3/swift-apple-skills --plugin ios-swift-skillsOther plugins' skills for the same job