Type Safely

Type Safely

Use The New SpatialTapGesture To Get The Location of Any Tap

Daily Coding Tip 138

Millie Sturgeon's avatar
Millie Sturgeon
Jul 27, 2022
∙ Paid
astronaut in spacesuit floating in space
Photo by NASA on Unsplash

It is now much easier to find the location of a tap using SpatialTapGesture. When the onEnded action is called for the gesture, an event that contains a location is passed into the closure. Similar to Apple’s documentation example, I am setting this location to a State property. For some reason Apple thought the most exciting ex…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture