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
Share
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…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture