I'm using SWRevealViewController to have a sidebar menu in my iOS app. Both my front and rear view controllers are table view controllers. My front view controller has a bar button item that displays the rear view controller, and I've also enabled the pan gesture to display the rear view controller. The problem is that the pan gesture recognizer works only the first time, but the bar button always launches the rear view controller.
If someone could help me fix it so the pan gesture always worked, that would be great, thanks.
The SWRevealViewController that toggles both views is launched from the storyboard. Here is the code for the front view controller:
- (void)setUpSidebarMenu {
self.navigationItem.leftBarButtonItem.target = self.revealViewController;
self.navigationItem.leftBarButtonItem.action = @selector(revealToggle:);
[self.tableView addGestureRecognizer:self.revealViewController.panGestureRecognizer];
[self.tableView addGestureRecognizer:self.revealViewController.tapGestureRecognizer];
}
Here is the code for the rear view controller:
- (void)setUpSidebarMenu {
self.navigationItem.leftBarButtonItem.target = self.revealViewController;
self.navigationItem.leftBarButtonItem.action = @selector(revealToggle:);
[self.tableView addGestureRecognizer:self.revealViewController.panGestureRecognizer];
}