三行代码禁用侧滑返回
2021-03-18 本文已影响0人
王煜仁
在viewWillAppear中添加以下代码即可
//禁用右滑返回
id traget = self.navigationController.interactivePopGestureRecognizer.delegate;
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:traget action:nil];
[self.view addGestureRecognizer:pan];