I have a UIScrollView instance with a subview that has its own UIPanGestureRecognizer which is used to move the subview inside the scrollview. I would like the pinch-to-zoom feature of the scrollview to have the top priority over the pan gesture. However, this is not the case: when starting to pinch with one finger over my subview, it will pan instead.
What I tried so far:
gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
: it will pan AND pinch[panGestureRecognizer requireGestureRecognizerToFail:scrollView.pinchGestureRecognizer];
: panning just won't work anymore (callback is triggered only forUIGestureRecognizerStateEnded
state). AndpanGestureRecognizer.cancelsTouchesInView = NO
won't help.
My understanding is that when starting to pinch from the subview, both the scroll view and the subview only receive one touch each, that's why in the second case the pinch gesture recognizer doesn't even fail because it doesn't even begin to handle the event.
So, any idea on how to achieve this?