Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slide reveal only with screen edge gesture #775

Open
PrakashMaharjan opened this issue Mar 19, 2018 · 3 comments
Open

slide reveal only with screen edge gesture #775

PrakashMaharjan opened this issue Mar 19, 2018 · 3 comments

Comments

@PrakashMaharjan
Copy link

How can we restrict sliding of the reveal only with screen edge gesture rather than on swiping any where on screen.
Currently the reveal slides and show left option menu even when we swipe to right from right edge..

@iDevelopper
Copy link

You will find the response here: #690 or #699.

You can also just use:

self.revealViewController.draggableBorderWidth = 50;

@iDevelopper
Copy link

- (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;
}

@PrakashMaharjan
Copy link
Author

PrakashMaharjan commented Mar 20, 2018

Thank you so much @iDevelopper

noticed that setting reveal view draggable border width as below

self.revealViewController.draggableBorderWidth = 50;

works but found that after opening reveal, it does not close the reveal by dragging.

but the setting reveal delegate and adding delegate method works perfectly.

Just a question, is there a way to share the above delegate method in all views or do we need to add the code in every view controller?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants