I am creating a MKMapView
with some AnnotationView
s with CalloutBubbles and so on.
Now I want to add a UITapGestureRecognizer
to show the mapview in fullscreen mode like it's well done in the Maps App from Apple. I have still created the code to hide the NavigationBarItems, etc. and it works well but my problem is that the tap gesture is still in use for selecting the annotations. So every time I want to touch the PinView, make a doubleTap, etc. my code is executed and the mapview goes into fullscreen instead of opening the calloutBubble, zoom, etc.
Here is my question. Is there a possibility to separate between taps in the background of the MKMapView
and taps on the pins?
EDIT
When I use the - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
function and make a single tap on a annotation pin of my mapview I log this descriptions:
2014-02-24 15:27:31.257 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.257 MyApplication [807:70b] <_MKUserInteractionGestureRecognizer: 0xc80c470; baseClass = UIGestureRecognizer; state = Began; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = ; target= <(action=handleTouch:, target=)>>
2014-02-24 15:27:31.258 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.258 MyApplication [807:70b] <_MKUserInteractionGestureRecognizer: 0xc80c470; baseClass = UIGestureRecognizer; state = Began; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = ; target= <(action=handleTouch:, target=)>>
2014-02-24 15:27:31.376 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.376 MyApplication [807:70b] ; target= <(action=handleLongPress:, target=)>>
2014-02-24 15:27:31.377 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.377 MyApplication [807:70b] <_MKUserInteractionGestureRecognizer: 0xc80c470; baseClass = UIGestureRecognizer; state = Ended; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = ; target= <(action=handleTouch:, target=)>>
2014-02-24 15:27:31.377 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.377 MyApplication [807:70b] ; target= <(action=handleTap:, target=)>; must-fail = { ; target= <(action=handleDoubleTap:, target=)>; numberOfTapsRequired = 2>, ; target= <(action=handlePan:, target=)>> }>
2014-02-24 15:27:31.378 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.378 MyApplication [807:70b] ; target= <(action=handleTwoFingerTap:, target=)>; numberOfTouchesRequired = 2>
2014-02-24 15:27:31.378 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.379 MyApplication [807:70b] ; target= <(action=handleTwoFingerLongPress:, target=)>>
2014-02-24 15:27:31.379 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.380 MyApplication [807:70b] ; target= <(action=handlePinch:, target=)>>
2014-02-24 15:27:31.380 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.380 MyApplication [807:70b] ; target= <(action=handlePan:, target=)>; must-fail-for = { ; target= <(action=handleTap:, target=)>> }>
2014-02-24 15:27:31.380 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.381 MyApplication [807:70b] ; target= <(action=handleRotation:, target=)>>
2014-02-24 15:27:31.381 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.381 MyApplication [807:70b] ; target= <(action=handleTilt:, target=)>>
2014-02-24 15:27:31.381 MyApplication [807:70b] ; target= <(action=MySetFullScreenMap, target=)>>
2014-02-24 15:27:31.382 MyApplication [807:70b] ; target= <(action=handleLongPress:, target=)>>
The in each case upper log is the "gestureRecognizer" and the lower one is the "otherGestureRecognizer".
I've just added a UILongPressGestureRecognizer and the UITapGestureRecognizer (for my function "MySetFullScreenMap"