У меня проблема с моим кодом.Я получаю это сообщение об ошибке:
Невозможно преобразовать значение типа 'CLLocationCoordinate2D' в ожидаемый тип аргумента '(CLLocationCoordinate2D) throws -> Bool'
if(locationManager.allowsBackgroundLocationUpdates && isDriving){
locationManager.startUpdatingLocation()
guard let locValue: CLLocationCoordinate2D = locationManager.location?.coordinate else { return }
Map.setCenter(locValue, animated: true)
Map.setRegion(MKCoordinateRegion(center: locValue, latitudinalMeters: 75, longitudinalMeters: 75), animated: true)
if !locations.contains(where: locValue) { //<- ERROR
locations.append(locValue);
NSLog("%f %f -> Gesamt: %d", locValue.latitude, locValue.longitude, locations.count);
let polyline = MKPolyline(coordinates: &locations, count: locations.count);
Map.addOverlay(polyline);
}
}
местоположений:
var locations = [CLLocationCoordinate2D]()