Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. func getUserLocation(callback: @escaping (CLLocation?) -> Void) {
  2.  
  3. // wait until user's location has been retrieved by location manager, somehow
  4.  
  5. // prepare output for callback function and pass it as its argument
  6. let latitude = manager.location?.coordinate.latitude
  7. let longitude = manager.location?.coordinate.longitude
  8. let location = CLLocation(latitude: latitude!, longitude: longitude!)
  9.  
  10. callback(location)
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement