iosswiftcllocationmanagercllocationcllocationcoordinate2d

how convert locations: [CLLocation] to Coordinate2D?


how cat get coordinate location of didUpdateLocation delegate ?

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) 

Please Help me.Thanks


Solution

  • the simple answer for this question in swift :

    (locations.first?.coordinate)!