How to find out distance between gps location coordinates in Swift?
byA very simple way to calculate the distance between two given CLLocationCoordinate2D is to first convert them to MKMapPoint which represents two-dimensional point on map.
let point1 = MKMapPoint(clcoordinate1)
let point2 = MKMapPoint(clcoordinate2)
Now, we just use distance(to:) method to receive the distance in meters. Below is the code:

