1
Ich möchte in der Lage sein, eine Schaltfläche und Label auf meiner Karte Annotation zu setzen. Die Annotation mit dem Titel, dem Untertitel und den Koordinaten funktioniert einwandfrei, aber ich kann keine Taste drücken.Wie man Knopf zu MKPointAnnotation in Swift hinzufügt
func drawEvents(_ loc: CLLocation, title1: String)
{
mapView.delegate = self//
let center = CLLocationCoordinate2D(latitude: loc.coordinate.latitude, longitude: loc.coordinate.longitude)
let lat: CLLocationDegrees = center.latitude
let long: CLLocationDegrees = center.longitude
self.pointAnnotation1 = MKPointAnnotation()
self.pointAnnotation1.title = title1
self.pointAnnotation1.subtitle = "Event"
self.pointAnnotation1.coordinate = CLLocationCoordinate2D(latitude: lat, longitude: long)
self.pinAnnotationView = MKPinAnnotationView(annotation: self.pointAnnotation1, reuseIdentifier: nil)
self.mapView.addAnnotation(self.pinAnnotationView.annotation!)
}
funktioniert super danke – Steve