swiftui-gestures

Implement and review SwiftUI gestures for iOS with @GestureState.

981|50|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill swiftui-gestures-dpearson2699
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-gestures
Source: https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/swiftui-gestures
Command: npx skills add https://github.com/dpearson2699/swift-ios-skills --skill swiftui-gestures-dpearson2699

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement, review, and improve gesture handling in SwiftUI applications, ensuring smooth and intuitive user interactions.

Core Features & Use Cases

  • Gesture Implementation: Add tap, long press, drag, magnify, and rotate gestures to your views.
  • Gesture Composition: Combine gestures using simultaneously, sequenced, and exclusively.
  • State Management: Utilize @GestureState for transient gesture feedback and @State for persistent changes.
  • Conflict Resolution: Manage parent/child gesture conflicts with highPriorityGesture and simultaneousGesture.
  • Custom Gestures: Build reusable custom gestures by conforming to the Gesture protocol.
  • Use Case: You need to implement a drag-and-drop interface for reordering items in a list, or a pinch-to-zoom functionality for an image viewer.

Quick Start

Implement a drag gesture on a view to update its offset using @GestureState.

Frequently Asked Questions about swiftui-gestures

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

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

Resolve SwiftUI gesture conflicts by applying highPriorityGesture to prioritize parent views or simultaneousGesture to allow both views to track interactions concurrently without blocking each other.

What's the best way to combine multiple gestures in SwiftUI?

Combine SwiftUI gestures using simultaneously, sequenced, or exclusively modifiers to define whether gestures trigger together, in order, or as mutually exclusive interactions on a single view.

How does @GestureState work for managing transient gesture state in SwiftUI?

@GestureState manages transient SwiftUI gesture state by automatically resetting its value to the initial state when the gesture ends, making it ideal for temporary visual feedback during interactions.

Can I create custom gestures in SwiftUI by conforming to the Gesture protocol?

Yes, build reusable custom SwiftUI gestures by conforming to the Gesture protocol, enabling the implementation of specialized drag, magnify, or rotate interactions beyond standard gesture types.

How do I implement drag and drop reordering with SwiftUI gestures?

Implement drag and drop reordering in SwiftUI by attaching a DragGesture to your views and updating their offset using @GestureState, allowing items to visually follow user touch input.

Does this support migrating to modern SwiftUI gesture APIs?

Yes, this supports migrating legacy gesture implementations to modern SwiftUI gesture APIs, ensuring your tap, long press, drag, magnify, and rotate interactions adhere to current iOS development standards.