Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
- // .requestLocation will only pass one location to the locations array
- // hence we can access it by taking the first element of the array
- if let location = locations.first {
- self.latitudeLabel.text = "\(location.coordinate.latitude)"
- self.longitudeLabel.text = "\(location.coordinate.longitude)"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement