Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func getCityInLocation(from
- location:CLLocation,completion:@escaping(_city:String?, _ error:Error?) ->()) {
- CLGeocoder().reverseGeocodeLocation(location) { placemarks, error in
- completion(placemarks ?.first ?.locality, error)
- }
- }
- let location = CLLocation(latitude:19.339248,longitude:-99.191345)
- getCityInLocation(from:location) { city, error in
- guard let city = city, error == nil else{
- return
- }
- print(city + "πLine 705") //
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement