圖片發自簡書App
// 處理側滑和圖片瀏覽器scrollView的手勢沖突問題
- (void)handleGestureRecognizer
{
NIPNavigationController * navigation = (NIPNavigationController*)self.navigationController;
[self.scroll.panGestureRecognizer requireGestureRecognizerToFail:navigation.gesture];
}
默認的UINavigationController支持屏幕邊緣滑動的返回功能,自定義的NIPNavigationController支持全屏側滑(思路:添加pan手勢執行系統的提供的側滑方法,并將pan手勢暴露在.h文件中),讓scrollView 的pan手勢優先級低于navigationController的pan手勢。