0

Right now, i have implemented this delegate method:

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control

However, I would like the callout view and its left/right to trigger different methods. As of right now, tapping at the callout view and its left accessory view produces the same output. How do I differentiate between callout view being tapped or the right callout accessory gets tapped?

Kann
  • 385
  • 1
  • 6
  • 22
  • 1
    Do you mean this: http://stackoverflow.com/questions/13691783/ios-distinguish-between-which-callout-accessory-is-tapped –  Nov 24 '13 at 13:26
  • Thanks! This helps. Never thought of UIControl as a UIView before; however, clicking at the callout directly still triggers the same method as the rightCallOutAccessoryView. How should I refer to the callOutView directly? – Kann Nov 24 '13 at 16:47
  • UIControl is a subclass of UIView. There's no documented/supported way to reference the callout view directly. However, at least on iOS 7, I think tapping on the callout view itself is interpreted as a "right" callout accessory view tap. –  Nov 24 '13 at 16:55
  • So... there's no way to differentiate between the tapping the callout view and the right accessory view? – Kann Nov 25 '13 at 03:56
  • No easy way that I know of. If absolutely necessary, you'd have to use a custom callout view which the SDK doesn't help you with much (set canShowCallout to NO and then show your own view in didSelectAnnotationView, etc). –  Nov 25 '13 at 17:51
  • Thanks @AnnaKarenina. I do not plan to implement the custom callout at the moment. Will live with the current implementation then. :) – Kann Nov 27 '13 at 05:44

0 Answers0