I am using SWRevealViewController to put a sidebar menu in my iOS app. Both my front and rear view controllers are the table view controller. In front of me, the View Controller has a button item that displays the rear view controller, and I have also enabled pan gestures to display the Rear View Controller. The problem is that the Pan gesture identifier works only for the first time, but the bar button always starts the rear view controller.
If someone can help me fix this, the pan gesture always worked, It would be great, thanks.
The SWRevealViewController toggle the two scenes is launched from the storyboard. The code for front view controller is:
- (zero) setUpSidebarMenu {self.navigationItem.leftBarButtonItem.target = self.revealViewController; Self.navigationItem.leftBarButtonItem.action = @selector (revealToggle :); [Self Taleviewview AdenineRecanizer: Self. Revael ViUi Controller. Constructor Reichiger]; [Self Taleviewview AdenineRecanizer: Self. Revael Vuii ControllerTapjestorRecKaniser]; }
The code for the rear view controller is:
- (zero) setUpSidebarMenu {self.navigationItem.leftBarButtonItem.target = self.revealViewController; Self.navigationItem.leftBarButtonItem.action = @selector (revealToggle :); [Self Taleviewview AdenineRecanizer: Self. Revael ViUi Controller. Constructor Reichiger]; },
solution, rear view to handle panning There should not be any code in the controller, and instead of adding gestures to self.tableView
, add them to self.view
: [self.view addGestureRecognizer: self.revealViewController .panGestureRecognizer ]; [Self.view addGestureRecognizer: self.revealViewController.tapGestureRecognizer];
No comments:
Post a Comment