swiftui-gestures

Resolve SwiftUI gesture conflicts and manage transient state with @GestureState.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/onymchat/onym-ios --skill swiftui-gestures-onymchat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-gestures
Source: https://github.com/onymchat/onym-ios/tree/main/.claude/skills/swiftui-gestures
Command: npx skills add https://github.com/onymchat/onym-ios --skill swiftui-gestures-onymchat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SwiftUI gesture handling can be error-prone when parent and child gestures collide, when complex compositions are required, or when transient state needs automatic resets.

Core Features & Use Cases

  • Learn and apply TapGesture, LongPressGesture, DragGesture, MagnifyGesture, and RotateGesture, including their composition with simultaneously, sequenced, and exclusively patterns.
  • Resolve conflicts in view hierarchies using .gesture, .highPriorityGesture, and .simultaneousGesture, and manage transient state with @GestureState.
  • Migrate from deprecated gestures to newer APIs and implement custom Gesture conformances for reusable interactions.

Quick Start

Create a demo view that recognizes drag and pinch gestures, properly handling gesture states and conflicts.

Frequently Asked Questions about swiftui-gestures

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I resolve SwiftUI gesture conflicts between parent and child views?

Resolve SwiftUI gesture conflicts by applying .highPriorityGesture or .simultaneousGesture modifiers to manage precedence and allow parent and child views to handle interactions without collision.

What is the best way to manage transient state during a drag gesture in SwiftUI?

Manage transient SwiftUI drag gesture state using the @GestureState property wrapper, which automatically resets the value to its initial state when the gesture ends or gets interrupted.

How do I combine tap and drag gestures in SwiftUI?

Combine SwiftUI tap and drag gestures using composition patterns like simultaneously, sequenced, or exclusively to define how multiple gestures interact within a single interactive UI component.

Can I use MagnifyGesture and RotateGesture together in SwiftUI?

Yes, you can use MagnifyGesture and RotateGesture together in SwiftUI by composing them simultaneously, allowing interactive UI components to respond to pinch and rotation inputs concurrently.

How do I migrate from deprecated gestures to newer SwiftUI APIs?

Migrate from deprecated SwiftUI gestures by replacing outdated gesture types with current TapGesture, DragGesture, MagnifyGesture, and RotateGesture implementations to ensure compatibility and proper gesture handling.