I have a UIPageViewController and each Page contains multiple UIViews on the page, each UIView allows Pan gesture after a longPress gesture, I use the following delegate in the contentVC, but it appears the pageVC doesn’t care my restriction below and it continue to flip the page! do I have to do anything to disable the page turning while I am in panning? (the last resort will be setting an variable at the PageVC like a canTurn, and set it to NO while the panning is in action….
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]] &&
[otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
return YES;
}
return NO;
}
You should add the
-gestureRecognizer:shouldReceiveTouch:method in the PageVC itself, or if you dont wanna add it in the PageVC itself you could let a delegate handle itLike:
or