# # #1. Problem Description: If A is a navigationcontroller rootviewcontroller, on this page Navigationbar is displayed (hidden property is NO), it pushes Tumbler stack come over the B view Controller, b page Navigationbar is not displayed (hidden property is yes), there is a chance to appear, B to right-slide pop himself to Tumbler stack A, the right swipe gesture will be invalidated, even if B set Self.navigationController.interactivePopGestureRecognizer.enabled = yes also does not work
# # #2. Problem analysis: In fact, the right slip gesture is blocked, the gesture still exists, need to rewrite its proxy method, so that the gesture is not blocked
# # #3. Resolution steps:
# # # #1. Write this line of code on page B: self.navigationController.interactivePopGestureRecognizer.delegate = self;
# # # #2. Let b page comply with UIGESTURERECOGNIZERDELEGATE protocol
# # # #3. Overriding the Gesturerecognizerdelegate method:
-(BOOL) Gesturerecognizershouldbegin: (Uigesturerecognizer *) gesturerecognizer{
if (Self.navigationController.viewControllers.count <= 1) {
Return no;//prevents the B page from being present, there is only one page, and the right swipe gesture is not available at this time
}
return YES;
}
about using Navigationcontroller, the solution to the problem of the right slip gesture failure is the different hidden properties of the front and rear 2 view controllers Navigationbar