Find closest location between user's coordinates and coordinates array
问题 I want to create a function that takes as parameters: An array filled of coordinates The current user location And return the closest location between the user's location and the array locations. Here are my locations: let coord1 = CLLocation(latitude: 52.45678, longitude: 13.98765) let coord2 = CLLocation(latitude: 52.12345, longitude: 13.54321) let coord3 = CLLocation(latitude: 48.771896, longitude: 2.270748000000026) User location function: func locationManager(_ manager: CLLocationManager