Disable swipe back gesture in Swift

后端 未结 10 1472
轻奢々
轻奢々 2020-12-02 09:47

Been looking around on here for a while but can\'t seem to find a working solution.

I\'m trying to disable the swipe to go back to previous view gesture, in Swift.

10条回答
  •  無奈伤痛
    2020-12-02 10:23

    for objective -c

    -(void)viewWillAppear:(BOOL)animated{
      [super viewWillAppear:true];
    
      self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    
    }
    

提交回复
热议问题