← ClaudeAtlas

swift-motion-gestureslisted

Build drag, swipe, fling and hold interactions in SwiftUI that track the finger 1:1, hand the release velocity to the settle spring and snap by projected momentum. Use it whenever building or fixing code that uses DragGesture, @GestureState, gesture velocity or predictedEndTranslation, or when building swipe-to-dismiss cards, toasts and photo viewers, custom drawers and detents (including choosing between a system sheet and a custom one), swipe cards, swipe-to-reveal or swipe-to-delete rows, drag-to-reorder, PiP-style throws, hold-to-confirm, rubber-banding, or a drag that fights a ScrollView. Use it too for complaints like "it doesn't follow my finger", "it jumps when I let go", "the fling feels dead" or "I can't grab it mid-animation". Send tap-driven animation, transitions and choreography to swift-motion-animate, reviews and audits of existing motion to swift-motion-review, and worst-case layout testing to swift-motion-break-ui.
v-murygin/swift-motion · ★ 0 · AI & Automation · score 72
Install: claude install-skill v-murygin/swift-motion
# Gesture-driven motion A gesture is direct manipulation: while the finger is down, the UI is the finger; the moment it lifts, physics takes over. Every rule below follows from that split. The goal is a view that is glued to the finger, keeps moving the way it was thrown, and can be grabbed again at any moment. Baseline iOS 17. Newer APIs are marked **(iOS 18)**, **(iOS 26)** or **(iOS 27)**. **Scope.** This skill covers motion a finger drives: tracking, release, snapping, dismissal, reordering, holds. Route the rest: - **swift-motion-animate**: tap-triggered transitions, press feedback (`ButtonStyle`), a toast's entrance and exit, list changes, choreography, performance of non-gesture motion. - **swift-motion-review**: auditing or trimming existing motion code. - **swift-motion-break-ui**: stress-testing layouts with worst-case data. **Where the guidance comes from.** Some of it is Apple's: SDK behaviour, the HIG, WWDC talks such as "Designing Fluid Interfaces" (2018) and "Animate with springs" (2023). The rest are house guidelines: thresholds and spring values chosen because they feel right next to the system, such as the 40 % commit point or the 0.3 s release springs. Follow both, but only the first is "Apple says"; keep that distinction when you explain a choice. ## 0. Editing the user's code The user asked for a gesture, not a refactor. Keep the change small enough to review at a glance: - **Stay inside the files the user named.** No new source files, no app-wi