我有一个 UIPageViewController 并且每个页面在页面上包含多个 UIViews,每个 UIView 允许在 longPress 手势后平移手势,我在 contentVC 中使用以下委托,但看起来 pageVC 不关心我下面的限制,它继续翻转这页纸!我在平移时是否必须做任何事情来禁用翻页?(最后的手段是像 canTurn 一样在 PageVC 上设置一个变量,并在平移运行时将其设置为 NO....
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]] &&
[otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
return YES;
}
return NO;
}