swiftui-gestures

Implement and review SwiftUI gesture handling with @GestureState and composition.

155|22|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/omarshahine/HomeClaw --skill swiftui-gestures-omarshahine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-gestures
Source: https://github.com/omarshahine/HomeClaw/tree/main/.agents/skills/swiftui-gestures
Command: npx skills add https://github.com/omarshahine/HomeClaw --skill swiftui-gestures-omarshahine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers implement, review, and improve gesture handling in SwiftUI applications, ensuring modern and robust user interactions.

Core Features & Use Cases

  • Gesture Implementation: Add tap, long press, drag, magnify, and rotate gestures.
  • Gesture Composition: Combine gestures using .simultaneously, .sequenced, and .exclusively.
  • State Management: Utilize @GestureState for transient gesture states and @State for persistent ones.
  • Conflict Resolution: Manage parent/child gesture conflicts with .highPriorityGesture and .simultaneousGesture.
  • Custom Gestures: Build custom gestures by conforming to the Gesture protocol.
  • Use Case: Implement a complex image manipulation interface where users can simultaneously pinch to zoom and rotate an image, with smooth animations and intuitive state management.

Quick Start

Implement a drag gesture on a view that updates its position using @GestureState and persists the final offset using @State.

Frequently Asked Questions about swiftui-gestures

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

FAQPage Schema
How do I manage state during SwiftUI gesture interactions?

Combine SwiftUI gestures using .simultaneously, .sequenced, or .exclusively modifiers. This allows you to trigger multiple gestures at once, chain them in order, or ensure only one executes based on initial touch recognition.

Why do parent and child gesture conflicts happen in SwiftUI and how do I fix them?

Parent and child gesture conflicts in SwiftUI happen when multiple views attempt to handle the same touch. Resolve them by applying .highPriorityGesture to favor a specific gesture or .simultaneousGesture to allow both to track concurrently.

What is the best way to implement pinch to zoom and rotate simultaneously in SwiftUI?

The best way to implement simultaneous pinch to zoom and rotate in SwiftUI is by composing magnify and rotate gestures using the .simultaneously modifier. This tracks both touch inputs concurrently while updating view transforms via state management.

Can I build custom gestures in SwiftUI beyond the standard tap and drag?

You can build custom gestures in SwiftUI by conforming to the Gesture protocol. This allows you to define unique touch recognition logic and integrate it directly into your view hierarchy for specialized UI interactions.