Closed yaosarayin closed 3 years ago
I think the Yelpy project also has some information on this
Next thing to do after creating a new modal screen for populating the text field with the result of the above, is to set up a delegate to retrieve the information computed in the modal screen: follow these instructions
Code for getting the distance of the ride in miles
import CoreLocation
let coordinate₀ = CLLocation(latitude: 5.0, longitude: 5.0)
let coordinate₁ = CLLocation(latitude: 5.0, longitude: 3.0)
let distanceInMeters = coordinate₀.distance(from: coordinate₁) // result is in meters
let milesPerMeter = 0.000621371192
let distanceInMiles = distanceInMeters * milesPerMeter
check out #14 for Taha's research on this