iOS全屏滑动返回

#import “GLNavigationController.h”
@interface GLNavigationController ()
@end
@implementation GLNavigationController
- (void)viewDidLoad {
[super viewDidLoad];
id target = self.interactivePopGestureRecognizer.delegate;
SEL handler = NSSelectorFromString(@”handleNavigationTransition:”);
// 获取添加系统边缘触发手势的View
UIView *targetView = self.interactivePopGestureRecognizer.view;
// 创建pan手势 作用范围是全屏
UIPanGestureRecognizer * fullScreenGes = [[UIPanGestureRecognizer alloc]initWithTarget:target action:handler];
fullScreenGes.delegate = self;
[targetView addGestureRecognizer:fullScreenGes];
// 关闭边缘触发手势 防止和原有边缘手势冲突
[self.interactivePopGestureRecognizer setEnabled:NO];
}

// 防止导航控制器只有一个rootViewcontroller时触发手势
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
return self.childViewControllers.count == 1 ? NO : YES;
}
@end

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_16270605/article/details/52368802
文章标签: ios
个人分类: ios 学习笔记
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭