天天看点

iOS :navigationbar隐藏之后手动加侧滑返回

//显示navigationbar
- (void)viewWillAppear:(BOOL)animated{ 
        [self.navigationController setNavigationBarHidden: YES];

//隐藏navigationbar
-(void)viewWillDisappear:(BOOL)animated{
        [self.navigationController setNavigationBarHidden: NO];

//侧滑返回手势
 UIScreenEdgePanGestureRecognizer *gesture = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(clickBackBtn)];

 gesture.edges = UIRectEdgeLeft;

[self.view addGestureRecognizer:ges];