What problem does it solve?
Implementing responsive, accessible input handling for macOS SwiftUI apps is challenging due to gaps in SwiftUI's built-in gesture APIs, platform-specific quirks, and the need to bridge to AppKit for advanced use cases like custom cursor control, global hotkeys, and pressure-sensitive input. Incorrect implementation leads to unresponsive controls, missed input events, and broken accessibility compliance.
Core Features & Use Cases
- Full Gesture API Coverage: Implement all common macOS input patterns including tap, long-press, drag, pinch-to-zoom, rotation, hover, scroll wheel, right-click context menus, and keyboard shortcuts using native SwiftUI modifiers.
- AppKit Bridge Patterns: Reliably handle edge cases SwiftUI does not support natively via NSViewRepresentable and NSEvent APIs, including custom cursor management, global event monitoring, trackpad finger mapping, and pressure-sensitive input.
- Use Case: For a vector drawing app, use this skill to implement pinch-to-zoom, custom crosshair cursor control, pressure-sensitive brush strokes via trackpad, and right-click context menus for tool selection, all with proper accessibility support.
Quick Start
Use the swiftui-macos-gestures skill to add custom hover cursor control and pinch-to-zoom functionality to your macOS SwiftUI drawing canvas, following the provided NSViewRepresentable and MagnifyGesture reference patterns.