mapView(_:annotationView:calloutAccessoryControlTapped:)
Tells the delegate when the user taps one of the annotation view’s accessory buttons.
Declaration
optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl)Parameters
- mapView:
The map view containing the specified annotation view.
- view:
The annotation view with the button that the person taps.
- control:
The control that the person taps.
Discussion
Accessory views contain custom content and the map view positions it on either side of the annotation title text. If a view you specify is a descendant of the UIControl class, the map view calls this method as a convenience whenever the user taps your view. You can use this method to respond to taps and perform any actions associated with that control. For example, if your control displays additional information about the annotation, you can use this method to present a modal panel with that information.
If your custom accessory views aren’t descendants of the UIControl class, the map view doesn’t call this method.