Last active
December 29, 2020 22:38
-
-
Save mmar/516defc4e22fe12edd7781ed23507f67 to your computer and use it in GitHub Desktop.
Geocoding in Xcode playgrounds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MapKit | |
import PlaygroundSupport | |
let mapView = MKMapView() | |
PlaygroundPage.current.liveView = mapView | |
CLGeocoder().geocodeAddressString("1 Apple Park Way, Cupertino, CA") { | |
(places, _) in | |
guard let places = places?.map(MKPlacemark.init) else { return } | |
mapView.showAnnotations(places, animated: true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment