← ClaudeAtlas

swiftui-gestureslisted

Implement, review, or improve SwiftUI gesture handling. Use when adding tap, long press, drag, magnify, or rotate gestures, composing gestures with simultaneously/sequenced/exclusively, managing transient state with @GestureState, resolving parent/child gesture conflicts with highPriorityGesture or simultaneousGesture, building custom Gesture protocol conformances, or migrating from deprecated MagnificationGesture to MagnifyGesture or using the newer RotateGesture.
dpearson2699/swift-ios-skills · ★ 730 · AI & Automation · score 80
Install: claude install-skill dpearson2699/swift-ios-skills
# SwiftUI Gestures (iOS 26+) Review, write, and fix SwiftUI gesture interactions. Apply modern gesture APIs with correct composition, state management, and conflict resolution using Swift 6.3 patterns. ## Contents - [Gesture Overview](#gesture-overview) - [TapGesture](#tapgesture) - [LongPressGesture](#longpressgesture) - [DragGesture](#draggesture) - [MagnifyGesture (iOS 17+)](#magnifygesture-ios-17) - [RotateGesture (iOS 17+)](#rotategesture-ios-17) - [Gesture Composition](#gesture-composition) - [@GestureState](#gesturestate) - [Adding Gestures to Views](#adding-gestures-to-views) - [Custom Gesture Protocol](#custom-gesture-protocol) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Gesture Overview | Gesture | Type | Value | Since | |---|---|---|---| | `TapGesture` | Discrete | `Void` | iOS 13 | | `LongPressGesture` | Discrete | `Bool` | iOS 13 | | `DragGesture` | Continuous | `DragGesture.Value` | iOS 13 | | `MagnifyGesture` | Continuous | `MagnifyGesture.Value` | iOS 17 | | `RotateGesture` | Continuous | `RotateGesture.Value` | iOS 17 | | `SpatialTapGesture` | Discrete | `SpatialTapGesture.Value` | iOS 16 | **Discrete** gestures fire once (`.onEnded`). **Continuous** gestures stream updates (`.onChanged`, `.onEnded`, `.updating`). ## TapGesture Recognizes one or more taps. Use the `count` parameter for multi-tap. ```swift // Single, double, and triple tap TapGesture() .onEnded { tapped.toggle