Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. func getCityInLocation(from
  2. location:CLLocation,completion:@escaping(_city:String?, _ error:Error?) ->()) {
  3. CLGeocoder().reverseGeocodeLocation(location) { placemarks, error in
  4. completion(placemarks ?.first ?.locality, error)
  5. }
  6. }
  7.  
  8. let location = CLLocation(latitude:19.339248,longitude:-99.191345)
  9.  
  10. getCityInLocation(from:location) { city, error in
  11. guard let city = city, error == nil else{
  12. return
  13. }
  14.  
  15. print(city + "πŸ„Line 705") //
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement