Skip to content

Instantly share code, notes, and snippets.

@malcommac
Last active May 1, 2016 09:33
Show Gist options
  • Select an option

  • Save malcommac/b067ad25975153ffd02dd65a5ca1b2a0 to your computer and use it in GitHub Desktop.

Select an option

Save malcommac/b067ad25975153ffd02dd65a5ca1b2a0 to your computer and use it in GitHub Desktop.
Reverse Geocoding with SwiftLocation
let address = "1 Infinite Loop, Cupertino (USA)"
LocationManager.shared.reverseAddress(address: address, onSuccess: { foundPlacemark in
// foundPlacemark is a CLPlacemark object
}) { error in
// failed to reverse geocoding due to an error
}
let coordinates = CLLocationCoordinate2DMake(41.890198, 12.492204)
// Use Google service to obtain placemark
LocationManager.shared.reverseLocation(service: .Google, coordinates: coordinates, onSuccess: { foundPlacemark in
// foundPlacemark is a CLPlacemark object
}) { error in
// failed to reverse geocoding
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment