I have a custom annotation view on the map, which has a UIButton
in it, but the UIButton
is not responsive when pressed. I have two main problems with user interaction on the annotation view:
- Buttons and other controls are not responsive.
- I want the annotation to block touches according to my implementation of
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event
- that is if I return YES then I don't want the touches to get sent through to theMKMapView
(potentially selecting other annotations that are BEHIND my annotation view), I want to handle the touch myself in this case.
I have made sure userInteractionEnabled
is set to YES
and I have investigated how touches are sent to the custom annotation view (my subclass of MKAnnotationView
) by overriding touchesBegan
etc. - but it appears that the touches are usually cancelled (thought I've managed to get touchesEnded
a few times) - so it seems like it will even be difficult to manually implement any user-interaction with the custom annotation view.
Does anyone have any insights into allowing more user interaction with MKAnnotationView
objects?