这里主要针对FDFullscreenPopGesture
示例处理,其他同类手势即可按照此方法处理。
详情请参考OC版本示例demo类FullScreenGestureViewController
- 实现相关代理方法
- (Class)scrollViewClassInlistContainerViewInPagerView:(JXPagerView *)pagerView {
return [FullScreenGestureScrollView class];
}
- 然后在
FullScreenGestureScrollView
自定义类里面实现手势代理方法 参考的是FDFullscreenPopGesture的官方文档View Controller With ScrollView
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
if (collectionView.contentOffset.x <= 0) {
if ([otherGestureRecognizer.delegate isKindOfClass:NSClassFromString(@"_FDFullscreenPopGestureRecognizerDelegate")]) {
return YES;
}
}
return NO;
}
- 遵从
JXCategoryCollectionViewGestureDelegate
协议
self.categoryView.collectionView.gestureDelegate = self
- 实现相关代理方法
- (BOOL)categoryCollectionView:(JXCategoryCollectionView *)collectionView gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
if (collectionView.contentOffset.x <= 0) {
if ([otherGestureRecognizer.delegate isKindOfClass:NSClassFromString(@"_FDFullscreenPopGestureRecognizerDelegate")]) {
return YES;
}
}
return NO;
}