I would like to detect if the rightCalloutAccessoryView has been tapped via the delegate method below, how can I do that?
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)contro
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
calloutAccessoryControlTappedmethod will be triggered for the tap action on bothleftCalloutAccessoryViewandrightCalloutAccessoryView. To distinguish the accessory views, you can settagfor both the accessory views while you create them. And in yourcalloutAccessoryControlTappedmethod, you can check the tag value and do the respective action depending on the tag value.For example, consider you have set
1and2for thetagsof yourleftandrightaccessory view respectively. Then yourcalloutAccessoryControlTappedmethod will look something like the following,