1
Я хочу, чтобы на моей аннотации карты была помечена кнопка и ярлык. Аннотации с заголовком, субтитрами и координатами работают отлично, но я не могу получить кнопку для появления.Как добавить кнопку в MKPointAnnotation в Swift
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!)
}
отлично работает – Steve