Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWRevealViewController how to remove swipe gesture

I am using good control SWRevealViewController, but by some redone I want to track my own swipe gestures on my screen. So how can I switch off swipe options? I want to work only revealToggle method that attached to my button. Did someone faced with this? Thank you

like image 264
Matrosov Oleksandr Avatar asked Mar 02 '14 23:03

Matrosov Oleksandr


1 Answers

In order to disable the swipe gesture you can simple do:

self.revealViewController.panGestureRecognizer.enabled=NO;

For example:

-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.revealViewController.panGestureRecognizer.enabled=NO;
}

-(void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    self.revealViewController.panGestureRecognizer.enabled=YES;
}
like image 145
matteolel Avatar answered Nov 08 '22 11:11

matteolel