The Haversine distance formula determines the great-circle distance between two points on a sphere given their longitudes and latitudes.
Add a package to your Xcode project by select File > Swift Packages > Add Package Dependency and enter https://github.com/tmn/HaversineDistance
.
import haversineFormula
let haversine = Haversine.distance(
firstLocation: (63.421798, 10.394786),
secondLocation: (63.416191, 10.431693)
)