How to solve the problem of right slide gesture failure caused by different hidden attributes of the two view controllers navigationBar using navigationController
### 1. problem description: for example, A is the rootViewController of navigationController, And the navigationBar is displayed on this page (the hidden attribute is NO). It pushes the stack to the B View Controller, B page navigationBar is not displayed (the hidden attribute is YES), there is A certain probability that it will appear, B needs to slide right to pop itself to stack A, the right slide gesture will become invalid, even if self. navigationController. interactivepopgsturerecognizer. enabled = YES does not work either.
### 2. Problem Analysis: Because the right-sliding gesture is blocked and the gesture still exists, you need to rewrite its proxy method so that the gesture is not blocked.
### 3. Solution steps:
#### 1. Write this line code on page B: self. navigationController. interactivepopgsturerecognizer. delegate = self;
#### 2. Enable page B to comply with the UIGestureRecognizerDelegate Protocol
#### 3. Override the GestureRecognizerDelegate method:
-(BOOL) gestureRecognizerShouldBegin :( UIGestureRecognizer *) gestureRecognizer {
If (self. navigationController. viewControllers. count <= 1 ){
Return NO; // prevents B from having only one page. At this time, the right slide gesture is not used.
}
Return YES;
}