swiftui-gestures

Implement SwiftUI gesture composition and conflict resolution for touch-based apps.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill swiftui-gestures-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-gestures
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/swiftui-gestures
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill swiftui-gestures-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SwiftUI gesture handling often becomes fragile when gestures need to compose correctly, manage transient state, and avoid parent/child conflicts, leading to inconsistent touch behavior.

Core Features & Use Cases

  • Modern gesture APIs for iOS 17+: Use MagnifyGesture and RotateGesture instead of deprecated variants for pinch/rotate interactions.
  • Correct gesture composition: Compose gestures with .simultaneously(with:), .sequenced(before:), and .exclusively(before:) to model real multi-gesture UX.
  • Transient state done right: Use @GestureState and .updating() to provide responsive UI feedback that automatically resets.
  • Priority and conflict resolution: Fix swallowed taps and competing interactions via .gesture(), .highPriorityGesture(), .simultaneousGesture(), and GestureMask.
  • Reusable custom gestures: Create Gesture-conforming types and ergonomic View extensions for consistent interaction patterns.
  • Performance-aware gesture handling: Keep onChanged lightweight and defer expensive work to onEnded to avoid stutter.

Quick Start

Apply the swiftui-gestures guidance to your SwiftUI view by choosing the correct gesture type(s), wiring transient feedback with @GestureState and .updating(), and resolving any parent/child conflicts using the appropriate gesture composition or priority modifier.

Frequently Asked Questions about swiftui-gestures

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

FAQPage Schema
How do I resolve parent/child gesture conflicts in SwiftUI?

Resolve SwiftUI gesture conflicts by applying `.highPriorityGesture()`, `.simultaneousGesture()`, or `GestureMask` to manage competing interactions and prevent swallowed taps across view hierarchies.

How do I compose multiple SwiftUI gestures like drag and pinch?

Compose SwiftUI gestures using `.simultaneously(with:)`, `.sequenced(before:)`, and `.exclusively(before:)` to model complex multi-touch UX patterns like combining drag with pinch-to-zoom interactions.

How does @GestureState work for transient UI feedback in SwiftUI?

`@GestureState` in SwiftUI manages transient state during gestures via `.updating()`, providing responsive UI feedback that automatically resets when the interaction ends or gets cancelled.

Why does my SwiftUI drag gesture cause UI stutter?

SwiftUI drag gesture stutter occurs when `onChanged` performs heavy computations; keep `onChanged` lightweight and defer expensive work to `onEnded` to maintain smooth touch performance.

Should I use MagnifyGesture or MagnificationGesture for SwiftUI pinch-to-zoom?

Use `MagnifyGesture` for SwiftUI pinch-to-zoom on iOS 17+, as `MagnificationGesture` is deprecated. `RotateGesture` similarly replaces the deprecated rotation interaction variant.

Can I create reusable custom gesture types in SwiftUI?

Create reusable SwiftUI custom gestures by defining `Gesture`-conforming types and ergonomic `View` extensions, ensuring consistent interaction patterns across your app's view hierarchy.