Commit 6ea53f348a23972b7d24b41651c842358379ebdb
1 parent
83487e3c
no message
Showing
3 changed files
with
7 additions
and
3 deletions
CNLiveBaseClass.podspec
CNLiveBaseClass/Classes/Controller/CNLiveBaseViewController.h
| ... | ... | @@ -13,7 +13,6 @@ NS_ASSUME_NONNULL_BEGIN |
| 13 | 13 | @interface CNLiveBaseViewController : UIViewController |
| 14 | 14 | // 是否隐藏导航栏 |
| 15 | 15 | @property (nonatomic, assign) BOOL navigationHidden; |
| 16 | -@property (nonatomic, assign) BOOL interactive; | |
| 17 | 16 | // 子类重写添加子视图方法 |
| 18 | 17 | - (void)createSubViews; |
| 19 | 18 | ... | ... |
CNLiveBaseClass/Classes/Controller/CNLiveBaseViewController.m
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | // 禁止页面左侧滑动返回,注意,如果仅仅需要禁止此单个页面返回,还需要在viewWillDisapper下开放侧滑权限 |
| 27 | 27 | // 禁用返回手势 |
| 28 | 28 | if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { |
| 29 | - self.navigationController.interactivePopGestureRecognizer.enabled = self.interactive; | |
| 29 | + self.navigationController.interactivePopGestureRecognizer.enabled = YES; | |
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
| ... | ... | @@ -54,6 +54,11 @@ |
| 54 | 54 | _navigationBar.hidden = navigationHidden; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | +#pragma mark - 左滑手势返回协议 | |
| 58 | +- (BOOL)forceEnableInteractivePopGestureRecognizer { | |
| 59 | + return YES; | |
| 60 | +} | |
| 61 | + | |
| 57 | 62 | /* |
| 58 | 63 | #pragma mark - Navigation |
| 59 | 64 | ... | ... |