自定义 UINavigationController 的返回按钮
2017-08-02 本文已影响11人
熊梓君
如果手动定制了返回按钮,右滑的手势将会失效,也就是自定义了 navigationItem 的 leftBarButtonItem,右滑的手势就会失效,解决方法如下:
@interface BaseNavigationController() < UIGestureRecognizerDelegate>
@end
@implementation BaseNavigationController
#pragma mark - Controller life cycle
- (void)viewDidLoad {
[super viewDidLoad];
self.interactivePopGestureRecognizer.delegate = self;
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
return YES;
}