Use when implementing SwiftUI gestures (tap, drag, long press, magnification, rotation), composing gestures, managing gesture state, or debugging gesture conflicts - comprehensive patterns for gesture recognition, composition, accessibility, and cross-platform support
View on GitHubSelect agents to install to:
npx add-skill https://github.com/CharlesWiltgen/Axiom/blob/main/.claude-plugin/plugins/axiom/skills/axiom-swiftui-gestures/SKILL.md -a claude-code --skill axiom-swiftui-gesturesInstallation paths:
.claude/skills/axiom-swiftui-gestures/# SwiftUI Gestures Comprehensive guide to SwiftUI gesture recognition with composition patterns, state management, and accessibility integration. ## When to Use This Skill - Implementing tap, drag, long press, magnification, or rotation gestures - Composing multiple gestures (simultaneously, sequenced, exclusively) - Managing gesture state with GestureState - Creating custom gesture recognizers - Debugging gesture conflicts or unresponsive gestures - Making gestures accessible with VoiceOver - Cross-platform gesture handling (iOS, macOS, axiom-visionOS) ## Example Prompts These are real questions developers ask that this skill is designed to answer: #### 1. "My drag gesture isn't working - the view doesn't move when I drag it. How do I debug this?" → The skill covers DragGesture state management patterns and shows how to properly update view offset with @GestureState #### 2. "I have both a tap gesture and a drag gesture on the same view. The tap works but the drag doesn't. How do I fix this?" → The skill demonstrates gesture composition with .simultaneously, .sequenced, and .exclusively to resolve gesture conflicts #### 3. "I want users to long press before they can drag an item. How do I chain gestures together?" → The skill shows the .sequenced pattern for combining LongPressGesture with DragGesture in the correct order #### 4. "My gesture state isn't resetting when the gesture ends. The view stays in the wrong position." → The skill covers @GestureState automatic reset behavior and the updating parameter for proper state management #### 5. "VoiceOver users can't access features that require gestures. How do I make gestures accessible?" → The skill demonstrates .accessibilityAction patterns and providing alternative interactions for VoiceOver users --- ## Choosing the Right Gesture (Decision Tree) ``` What interaction do you need? ├─ Single tap/click? │ └─ Use Button (preferred) or TapGesture │ ├─ Drag/pan movement? │ └─ Use DragGesture │ ├─ Hold b