Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
  2. // .requestLocation will only pass one location to the locations array
  3. // hence we can access it by taking the first element of the array
  4. if let location = locations.first {
  5. self.latitudeLabel.text = "\(location.coordinate.latitude)"
  6. self.longitudeLabel.text = "\(location.coordinate.longitude)"
  7. }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement