I'm new to programming in swift code and was hoping someone could help me with my project.
I would like to create an activity tracker that logs a users time and distance. Overall there is a total (say 200,000km) from London to Australia to achieve, routing through a few countries along the way.
Each time a user records an activity the total is reduced by the amount the user has recorded until the total is zero.
Secondly, I would like to show the overall progress on a map and record the progress from start.
I started by following a tutorial online that seems to be a good start. But I don't know how to log distance and time, and then do the bits above
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{
let location = locations[0]
let span:MKCoordinateSpan = MKCoordinateSpanMake(0.01, 0.01)
let myLocation:CLLocationCoordinate2D = CLLocationCoordinate2DMake(location.coordinate.latitude, location.coordinate.longitude)
let region:MKCoordinateRegion = MKCoordinateRegionMake(myLocation, span)
Map.setRegion(region, animated: true)
self.Map.showsUserLocation = true
}
Any help would be greatly appreciated.
Kind Regards,