RESideMenu
RESideMenu copied to clipboard
Disable pan gesture from one side.
I'd like to disable the swipe feature from one side to block the user from swiping from the left. Is there a way to disable the pan gesture from only one side instead of disabling the entire sidemenu? Right now I'm using [self.sideMenuViewController setPanGestureEnabled:NO]; but it blocks access to the right menu. thanks
I am also looking to solve the same issue as dslamowitz.
i got the answer... please use the below method then it work properly....
- (void)sideMenu:(RESideMenu *)sideMenu didRecognizePanGesture:(UIPanGestureRecognizer *)recognizer{
CGPoint vel = [rec velocityInView:self.view]; if (vel.x > 0) { // user dragged towards the right } else { // user dragged towards the left
}
}
if you want to diesable right then remove code from below method
- (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer;
and add in
- (void)sideMenu:(RESideMenu *)sideMenu didRecognizePanGesture:(UIPanGestureRecognizer *)recognizer;
you can also subclass RESideMenu and add this to disable one side
`override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if self.view.subviews.last?.frame.origin.x ?? 0 < 0 {
self.view.subviews.last?.frame.origin.x = 0
}
}'
granted there should be a better way to disable this ( allowing for nil viewcontrollers ideally )