Closed wvdk closed 3 years ago
Just do that:
[self.revealViewController panGestureRecognizer];
@wvdk I'm having the same issue – swiping doesn't reveal the rear view controller.
As suggested by http://www.appcoda.com/sidebar-menu-swift/ I added this snippet to the front's view controller viewDidLoad
method:
if revealViewController() != nil {
menuButton.target = self.revealViewController()
menuButton.action = #selector(SWRevealViewController.revealToggle(_:))
view.addGestureRecognizer(revealViewController().panGestureRecognizer())
}
This doesn't make swiping work. Tapping the menu button however reveals the rear view controller.
Edit: Swiping actually does work but only if I don't start swiping on the navigation bar. I expected to unreveal the rear view controller this way, too. Any ideas?
@iDevelopper Can you please provide a more detailed description how your suggestion is supposed to be applied?
Here is a sample I wrote for another thread (I use a subclass of SW but it is not mandatory). If you not, just call the tapGesture & panGesture in your first frontViewController:
Hope this help!
Another sample write with Objective-c:
Thank you very much, I will have a look into it how you solved it.
It works if I add
[_frontViewController.view addGestureRecognizer:_panGestureRecognizer];
tosetFrontViewPosition:animated:
, but I don't want to modify the source because I'm using Cocoapods.What am I missing? How do I add the correct panGestureRecognizer from inside of the frontVC? If anyone could point me in the right direction, that's be great.