self.navigationController.interactivePopGestureRecognizer.enabled = NO;ios
或spa
- (
void
)navigationController:(
UINavigationController
*)navigationController
didShowViewController
:(
UIViewController
*)viewController
animated
:(
BOOL
)animated
code
{
if
([
self
respondsToSelector
:
@selector
(interactivePopGestureRecognizer)]) {
if
(viewController
.class
== [
MyViewController
class
])
{
self
.interactivePopGestureRecognizer
.enabled
=
NO
;
}
else
{
self
.interactivePopGestureRecognizer
.enabled
=
YES
;
}
}
}