自定义 UINavigationController 的返回按钮,导致右滑返回手势失效

如果手动定制了返回按钮,右滑的手势将会失效,也就是自定义了 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;
}

你可能感兴趣的:(自定义 UINavigationController 的返回按钮,导致右滑返回手势失效)