Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func getUserLocation(callback: @escaping (CLLocation?) -> Void) {
- // wait until user's location has been retrieved by location manager, somehow
- // prepare output for callback function and pass it as its argument
- let latitude = manager.location?.coordinate.latitude
- let longitude = manager.location?.coordinate.longitude
- let location = CLLocation(latitude: latitude!, longitude: longitude!)
- callback(location)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement