Skip to content

Add tap gesture APIs and examples#908

Merged
Kyle-Ye merged 5 commits into
mainfrom
feature/tap_gestures
Jun 12, 2026
Merged

Add tap gesture APIs and examples#908
Kyle-Ye merged 5 commits into
mainfrom
feature/tap_gestures

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Add TapGesture support, including the public gesture API, tap-count handling, gesture phase mapping, and View.onTapGesture(count:perform:).
  • Add SpatialTapGesture support with coordinate-space location reporting and matching View.onTapGesture(count:coordinateSpace:perform:) overloads.
  • Add shared examples for TapGesture and SpatialTapGesture.
  • Add DocC documentation for the new gesture APIs and align availability annotations with OpenSwiftUI availability macros.

Related

@github-actions github-actions Bot added area: docs Documentation area label. area: event-gesture Events, gestures, tracing, or interaction plumbing. area: example Example apps, previews, sample projects, screenshots, or demo assets. type: feature New API, behavior, platform support, or user-facing capability. labels Jun 12, 2026
@augmentcode

augmentcode Bot commented Jun 12, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR introduces tap gesture support to OpenSwiftUI, including both basic tap detection and spatial tap location reporting.

Changes:

  • Added a new public TapGesture primitive gesture in OpenSwiftUICore, plus View.onTapGesture(count:perform:) convenience.
  • Added a new public SpatialTapGesture primitive gesture in OpenSwiftUI, including tap-count handling and coordinate-space location reporting.
  • Implemented shared internals for tap recognition via SingleTapGesture, using duration/movement thresholds, event filtering, repeat counting, and required tap-count preferences.
  • Added example views demonstrating TapGesture and SpatialTapGesture usage.
  • Hardened RepeatGesture by preconditioning that the repeat count is positive.
  • Updated DocC/availability annotations, including aligning Image.DynamicRange environment APIs with OpenSwiftUI availability macros.

Technical Notes: Spatial tap values map gesture phases from TappableSpatialEvent into a public value type containing the interaction location in the requested coordinate space.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread Sources/OpenSwiftUICore/Event/Gesture/TapGesture.swift
Comment thread Sources/OpenSwiftUI/Event/Gesture/SpatialTapGesture.swift
@Kyle-Ye Kyle-Ye mentioned this pull request Jun 12, 2026
@Kyle-Ye Kyle-Ye linked an issue Jun 12, 2026 that may be closed by this pull request
@Kyle-Ye Kyle-Ye merged commit ec8d089 into main Jun 12, 2026
1 of 7 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/tap_gestures branch June 12, 2026 15:35
Kyle-Ye added a commit that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation area label. area: event-gesture Events, gestures, tracing, or interaction plumbing. area: example Example apps, previews, sample projects, screenshots, or demo assets. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Gesture support

1 participant