Closed jrbecart closed 7 years ago
Could you elaborate please? What scroll? Pan gesture right to left is designed to close rear view. If rear view open again, it is because your pan length is not enough.
In the image below: 1: I touch the hamburger icon to open the menu. (It works) 2: I close the menu with gesture. (It works) 3: After I touch the screen (or slide or scroll) the menu open again.(My problem) 4: Menu is opening again.
If I want to close the menu properly I have to touch the hamburger icon or touch outside the menu. If open the menu with gesture, I can close it with gesture.(It works)
ave you implemented some delegate method?
Yes I have some delegate method.
Okay, what are they doing?
I manage notifications, I have utility method and also I have authentication method. (firebase based)
You could add a SW delegate method to allow open the menu by panning from the border of the screen like this:
- (BOOL)revealControllerPanGestureShouldBegin:(SWRevealViewController *)revealController {
CGPoint point = [revealController.panGestureRecognizer locationInView:self.view];
// Menu is close, pan gesture should begin if pan start from border
if (revealController.frontViewPosition == FrontViewPositionLeft && point.x < 50.0) {
return YES;
}
// Menu is open, pan gesture should begin
else if (revealController.frontViewPosition == FrontViewPositionRight) {
return YES;
}
return NO;
}
Thank you @iDevelopper, I tried this but it doesn't help, also for information my view is a uiwebview. It seems to works if it's not a uiwebview...
Ok then you have to implement also:
- (BOOL)revealController:(SWRevealViewController *)revealController panGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
I did not remember but you have also a property in SW named draggableBorderWidth which you can use instead of the delegate method:
self.revealViewController.draggableBorderWidth = 50;
It's much better! I can open & close with panGesture. I can open & close with tapGesture. I can't mix tapGesture and panGesture, like open with panGesture and close with tapGesture. I'm ok with your solutions, thank you.
If I open the menu with the icon (top left) and close the drawer with gesture (right to left), I can't scroll the page and when I remove my finger from the screen the drawer open again. Dis somebody notice that before?