Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.23 KB

全屏手势处理.md

File metadata and controls

41 lines (29 loc) · 1.23 KB

全屏手势处理

这里主要针对FDFullscreenPopGesture示例处理,其他同类手势即可按照此方法处理。

准备

  • JXCategoryView版本需要 1.3.4 版本及以上;

JXCategoryCollectionView处理

  • 遵从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;
}

JXCategoryListContainerView处理

  • 遵从JXCategoryListContainerViewDelegate协议

  • 实现相关代理方法

- (UIScrollView *)scrollViewInlistContainerView:(JXCategoryListContainerView *)listContainerView {
    //返回一个继承自`UIScrollView`的自定义类,然后自己在自定义类内部,处理手势。
    return customScrollView;
}