swiftui-gestures

Compose SwiftUI gestures with MagnifyGesture, RotateGesture, and @GestureState.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/DFly7/iOS-FastAPI-Supabase-AI --skill swiftui-gestures-dfly7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-gestures
Source: https://github.com/DFly7/iOS-FastAPI-Supabase-AI/tree/main/.agents/skills/swiftui-gestures
Command: npx skills add https://github.com/DFly7/iOS-FastAPI-Supabase-AI --skill swiftui-gestures-dfly7

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers often struggle to implement, compose, and maintain SwiftUI gesture interactions across iOS apps. This Skill provides a structured guide to correct usage, conflict resolution, and transient state management for reliable gestures.

Core Features & Use Cases

  • Comprehensive coverage of common SwiftUI gestures (TapGesture, LongPressGesture, DragGesture, MagnifyGesture, RotateGesture) and their correct composition using .simultaneously(with:), .sequenced(before:), and .exclusively(before:).
  • Guidance on using @GestureState for transient UI state and best practices to avoid conflicts between parent and child gestures.
  • Real-world scenarios and patterns for building accessible, responsive gestures in production apps.

Quick Start

Implement a sample SwiftUI view demonstrating Tap, Drag, Magnify, and Rotate gestures with proper state management.

Frequently Asked Questions about swiftui-gestures

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

FAQPage Schema
How do I compose SwiftUI gestures that need to fire simultaneously?

Compose SwiftUI gestures using the .simultaneously(with:) modifier to allow multiple gestures to trigger at the same time without blocking each other. This ensures robust interactions when users perform complex multi-touch actions.

What's the best way to handle transient state during a drag gesture in SwiftUI?

Handle transient state during a drag gesture in SwiftUI using the @GestureState property wrapper. It automatically resets the state to its initial value once the gesture ends, preventing UI inconsistencies and simplifying state management.

How do I resolve conflicts between parent and child gestures in SwiftUI?

Resolve SwiftUI gesture conflicts by applying composition patterns like .sequenced(before:) or .exclusively(before:). These modifiers define priority and execution order, ensuring child and parent views do not interfere with each other's interactions.

Can I use MagnifyGesture and RotateGesture together in a SwiftUI view?

Yes, you can use MagnifyGesture and RotateGesture together in a SwiftUI view by composing them simultaneously. This allows users to pinch and rotate an object at the same time, creating a fluid and responsive interactive experience.

Why does my SwiftUI DragGesture block scrolling in a list?

A SwiftUI DragGesture blocks scrolling when it captures touch events intended for the parent scroll view. Attach the gesture using .simultaneously(with:) or .highPriorityGesture to allow the underlying scroll component to function properly.