Is there any way to get the exact coordinates of tapped location (latitude, longitude or CLLocationCoordinate2D) on SwiftUI Map? I have found only this working method, however, is there any easier way to do it after the new SwiftUI release/updates?
I need to get the tapped location coordinates to later add annotations/pins on those locations using the coordinates.
Asked
Active
Viewed 842 times
1

degermon
- 31
- 1
- 5
-
1As far as I know `MapView` does not translate gesture coordinates to a `CLLocationCoordinate2D`. Using the `UIViewRepresentable` approach seems to be the best way. – sean woodward Oct 19 '21 at 19:13