Calculate Total Traveled Distance iOS Swift
update: Xcode 8.3.2 • Swift 3.1 The problem there is because you are always getting the same location over and over again. Try like this: import UIKit import MapKit class ViewController: UIViewController, CLLocationManagerDelegate { @IBOutlet weak var mapView: MKMapView! let locationManager = CLLocationManager() var startLocation: CLLocation! var lastLocation: CLLocation! var startDate: Date! var traveledDistance: Double … Read more