Ich möchte wissen, wie ich meine annotation
Titel zu aktualisieren, während ich es ziehen, weil alle annotation
Eigenschaften get
nur sind.Aktualisieren MKPointAnnotation Objekt beim Ziehen
-Code Ich habe try:
func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationViewDragState, fromOldState oldState: MKAnnotationViewDragState) {
switch (newState) {
case .starting:
//view.dragState = .dragging
print("dragging.....")
case .ending, .canceling:
// view.dragState = .none
let lat = view.annotation?.coordinate.latitude
let long = view.annotation?.coordinate.longitude
let coordinates = CLLocationCoordinate2D(latitude: lat!, longitude: long!)
print(" pin lat \(lat) long \(long)")
//Error here - title is get only property
view.annotation?.title = "New Location"
default: break
}
}
Dank Mann zu ändern !! es funktionierte. – ankit
Willkommen Kumpel, Happy Coding :) –