SwiftUI and MapKit - Find address from coordinates

I've seen a lot of posts around the internet about getting coordinates from an address, but none about how to do the opposite.

What I would like to do is allow a person to drop a pin and then programmatically look up the address closest to the pin. Like if I drop a pin inside a mall on the map I would like to capture the address to the mall.

Does anyone know how this could be done?

Answered by darkpaw in 801016022

It's called "reverse geocoding". Try this quick tutorial on YT: https://www.youtube.com/watch?v=2wxE8byc2FQ

It's from 3 years ago, and for Swift 4.2 and Xcode 10, so it might be a little out of date, but I think it should still work as you need.

Accepted Answer

It's called "reverse geocoding". Try this quick tutorial on YT: https://www.youtube.com/watch?v=2wxE8byc2FQ

It's from 3 years ago, and for Swift 4.2 and Xcode 10, so it might be a little out of date, but I think it should still work as you need.

To add to @darkpaw point. You could use CLGeocoder for converting between geographic coordinates and place names.

Converting between coordinates and user-friendly place names should help you get started.

SwiftUI and MapKit - Find address from coordinates
 
 
Q