I have a scenario where I have two UITableViews as a subview in a main UIView:
UIView (frame = full screen)
+--- UITableView (frame = ~1/3 of the screen)
+--- UITableView (frame = second ~1/3 of the screen)
I want to detect a three finger swipe up on the whole screen area (and also allow the user to pan UITableViews up and down with at least one finger).
I have a UISwipeGestureRecognizer attached to UIView with numberOfTouchesRequired = 3.
I've tried these:
- Setting both internal UIPanGestureRecognizers
maximumNumberOfTouchesto 1 on both UITableViews. To my understanding this should prevent two and three finger pans on the UITableViews but it doesn't. (If I setenabledto NO on these UIPanGestureRecognizers, the touches are correctly passed to the superview. But then the panning/scrolling doesn't work.) - Calling
panGestureRecognizer requireGestureRecognizerToFail:with myUISwipeGestureRecognizeron both UITableViews. This works partly, but the panning waits until the swipe hasn't been completed and it feels very clumsy. - Overriding UITableView with setting
shouldRecognizeSimultaneouslyWithGestureRecognizer:to return YES, which allows me to detect the three finger swipe. However, the UITableViews beneath pan/scroll up unintentionally.
So how do I limit the number of panning touches to 1 (or 2) and let the three-finger UISwipeGestureRecognizer recognize three finger swipes?