I have the following array which is loaded up with businesses:
var businessesArray = [Business]()
Now each Business has a latitude and longitude attribute:
private var _latitude: Double
private var _longitude: Double
What is the most efficient way (using swift) to sort businessesArray by putting business closest to the user at the start and farthest from the user at the end (sorted from nearest to farthest)? Assume I already have the user's current location in these variables:
var currentUserLatitude: Double
var currentUserLongitude: Double