Skip to content

Instantly share code, notes, and snippets.

@keitaoouchi
Created July 20, 2017 13:05
Show Gist options
  • Save keitaoouchi/0f5ff509980c09bf5694ff8189b894fa to your computer and use it in GitHub Desktop.
Save keitaoouchi/0f5ff509980c09bf5694ff8189b894fa to your computer and use it in GitHub Desktop.
func reverseGeocoding(location: CLLocation) {
let geocoder = CLGeocoder()
geocoder.reverseGeocodeLocation(location) { (placemarks, _) -> Void in
guard let placemarks = placemarks, !placemarks.isEmpty else { return }
if let placemark = placemarks.first {
log.debug(placemark)
}
}
/*
Optional(渋谷2丁目21番12号, 〒150-0002, 東京都渋谷区, 渋谷2丁目21番12号 @ <+35.65911670,+139.70329530> +/- 100.00m, region CLCircularRegion (identifier:'<+35.65911670,+139.70329530> radius 70.87', center:<+35.65911670,+139.70329530>, radius:70.87m))
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment