How to say that rightCalloutAccessoryView has been affected for MapKit

I have a MKAnnotationView that is highlighted with the DetailDisclosure button displayed on the right side of the annotation. How do I know when a user clicked on the annotation button? Here's what my code looks like right now -

UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.rightCalloutAccessoryView = rightButton;
pinView.animatesDrop = YES;

Is there a built-in method for detecting when an indirect view has been affected? I assume this will be similar to the UITableView methods, but I cannot find anything. Thanks for any help.

+3
source share
2 answers

You need some kind of object to be installed as your kind of map delegate, and implement the protocol method MKMapViewDelegate -mapView:annotationView:calloutAccessoryControlTapped:.

+5
source

mapView:annotationView:calloutAccessoryControlTapped: MKMapViewDelegate.

+1

Source: https://habr.com/ru/post/1740450/


All Articles