Builds or reviews SwiftUI tap, press, drag, magnify, and rotate interactions, including gesture composition, transient GestureState, custom gestures, and parent/child conflict resolution. Use for gesture recognition, arbitration, state, migration, or interaction bugs.
Ships in all-ios-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.
Review, write, and fix SwiftUI gesture interactions. Apply modern gesture APIs with correct composition, state management, and conflict resolution using Swift 6.4 patterns.
Scope boundary: This skill owns SwiftUI gesture recognition, composition, gesture state, and gesture-specific accessibility alternatives. Broader SwiftUI architecture/state ownership belongs in swiftui-patterns; list, scroll, form, and control layout belongs in swiftui-layout-components; broad UIKit bridging belongs in swiftui-uikit-interop.
When correcting Apple API availability, deprecation, or behavior claims, cite the relevant Sosumi or official Apple documentation URL in the response.
| Gesture | Type | Value | Since |
|---|---|---|---|
TapGesture | Discrete | Void | iOS 13 |
SpatialTapGesture | Discrete | SpatialTapGesture.Value | iOS 16 |
LongPressGesture | Discrete | Bool | iOS 13 |
DragGesture | Continuous | DragGesture.Value | iOS 13 |
MagnifyGesture | Continuous | MagnifyGesture.Value | iOS 17 |
RotateGesture | Continuous | RotateGesture.Value | iOS 17 |
Discrete gestures fire once (.onEnded). Continuous gestures stream updates (.onChanged, .onEnded, .updating).
// Tap: Use Button for standard actions; reserve TapGesture for multi-tap or location tracking
Text("Double tap").onTapGesture(count: 2) { handleDoubleTap() }
// Long press with transient pressing feedback
@GestureState private var isPressing = false
Circle()
.fill(isPressing ? .red : .blue)
.gesture(
LongPressGesture(minimumDuration: 0.8)
.updating($isPressing) { current, state, _ in state = current }
.onEnded { _ in triggerAction() }
)
// Drag with translation tracking
@State private var offset: CGSize = .zero
RoundedRectangle(cornerRadius: 16)
.offset(offset)
.gesture(
DragGesture(minimumDistance: 10, coordinateSpace: .local)
.onChanged { value in offset = value.translation }
.onEnded { _ in withAnimation(.spring) { offset = .zero } }
)
// Magnify and Rotate (iOS 17+; replaces deprecated MagnificationGesture / RotationGesture)
MagnifyGesture().onChanged { value in currentScale = value.magnification }
RotateGesture().onChanged { value in currentAngle = value.rotation }
Combine gestures using the three composition operators:
.simultaneously(with:): Both gestures evaluate together (e.g. pinch-to-zoom + rotate)..sequenced(before:): First gesture must succeed before second starts (e.g. long press before drag)..exclusively(before:): Only one succeeds; first has precedence (e.g. double tap before long press).let combined = MagnifyGesture()
.simultaneously(with: RotateGesture())
.onChanged { value in
if let mag = value.first { currentScale = mag.magnification }
if let rot = value.second { currentAngle = rot.rotation }
}
@GestureState: Automatically resets to initial value when gesture ends or cancels. Always use with .updating(&$state).@State: Persists values between interactions. Update in .onChanged (keep lightweight) and .onEnded.@GestureState private var dragOffset = CGSize.zero // resets on release
@State private var accumulatedOffset = CGSize.zero // persists across gestures
Control gesture arbitration across view hierarchy layers:
.gesture(_:): Lower precedence than child gestures..highPriorityGesture(_:): Parent gesture takes precedence over child gestures..simultaneousGesture(_:): Runs alongside child gestures without blocking them.GestureMask: Pass to .gesture(g, including: mask) (.all, .gesture, .subviews, .none).onTapGesture instead of Button: onTapGesture lacks VoiceOver accessibility traits, focus, and keyboard activation. Use Button with .buttonStyle(.plain) for custom visuals.MagnifyGesture and RotateGesture on iOS 17+, not MagnificationGesture or RotationGesture.onChanged: Keep onChanged closures frame-rate lightweight (60-120Hz). Defer heavy work or hit testing to .onEnded.LongPressGesture: Always pair long-press with @GestureState and .updating() to provide visual indication of press progress..highPriorityGesture() explicitly when parent gestures should win.MagnifyGesture / RotateGesture on iOS 17+)Button preferred over onTapGesture for single-tap actionable controls@GestureState used for transient offset/scale that resets automaticallyonChanged updates are lightweight without allocations or heavy queries.highPriorityGesture or .simultaneousGesture.first, .second).onEndedWhat SKILL.md sets; muted values are Claude Code's defaults
/all-ios-skills:swiftui-gesturesfrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job