swiftui-gestures

Implement, review, and enhance SwiftUI gesture handling across iOS versions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement, review, or improve SwiftUI gesture handling, ensuring your applications respond fluidly and intuitively to user input.

Core Features & Use Cases

  • Gesture Implementation: Add tap, long press, drag, magnify, or rotate gestures.
  • Gesture Composition: Combine gestures using simultaneously, sequenced, or exclusively.
  • State Management: Utilize @GestureState for transient gesture feedback and @State for persistent changes.
  • Conflict Resolution: Manage parent/child gesture conflicts with highPriorityGesture or simultaneousGesture.
  • Custom Gestures: Build your own reusable gestures by conforming to the Gesture protocol.
  • Use Case: You need to implement a pinch-to-zoom feature on an image within your SwiftUI app, ensuring it works smoothly alongside drag and rotation gestures.

Quick Start

Implement a drag gesture on a view that updates its position using @GestureState for visual feedback during the drag and @State to persist the final position.

Frequently Asked Questions about swiftui-gestures

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

FAQPage Schema
How do I implement pinch-to-zoom and drag gestures simultaneously in SwiftUI?

Implement simultaneous SwiftUI gestures using the simultaneousGesture modifier, allowing magnify and drag inputs to trigger together. Combine multiple gesture types like pinch-to-zoom and drag by attaching them to a single view without blocking each other's recognition.

What is the best way to manage transient SwiftUI gesture state?

Manage transient SwiftUI gesture state using the @GestureState property wrapper, which automatically resets to its initial value when a gesture ends. Use @State to persist permanent UI changes resulting from the gesture interaction.

Why do parent and child SwiftUI gestures conflict and how do I resolve it?

Parent and child SwiftUI gestures conflict when both attempt to recognize the same input, resolved using highPriorityGesture or simultaneousGesture modifiers. Apply highPriorityGesture to ensure a parent view's gesture takes precedence over its child's gesture.

Can I combine tap and long press gestures sequentially in SwiftUI?

Combine tap and long press gestures sequentially in SwiftUI using the sequenced method, which triggers the second gesture only after the first completes successfully. You can also use exclusively to ensure only one gesture activates.

Does SwiftUI support interoperation with UIKit gesture handling?

SwiftUI supports interoperation with UIKit gesture handling, allowing you to integrate existing UIKit components and gestures within SwiftUI views. This ensures smooth interaction across both frameworks during complex UI interactions.

How do I create custom gestures in SwiftUI?

Create custom gestures in SwiftUI by conforming to the Gesture protocol, building reusable gesture types that encapsulate specific recognition logic. This approach allows you to define unique gesture behaviors beyond the built-in tap, drag, magnify, and rotate options.