I have read the guidelines for contributing and I understand:
When I move from the main viewcontroller that holds the sidemenu to another viewcontroller, I can still open the sidemenu from there. How do i disable the pan gestures on the navigation bar and the screen edge?
I found a similar issue: https://github.com/jonkykong/SideMenu/issues/156 but there is no solution.
Any way you could help me out?
Thanks!
@aco314 the problem you're having is not the same as #156. You need to retain the gestures you add to the navigation bar (returned by the method that adds them) and disable them once you move to another screen. Read the README for more information.
My question was how do i disable them? I cant find nowhere in the README about that.
menuAddPanGestureToPresent and menuAddScreenEdgePanGesturesToPresent return the gestures added to those views. Simply set those gestures isEnabled properties to false or true as needed.
I am really sorry for bugging you this much, but could you please tell me exactly how to do that? I'm new to programming.
This is the way i thought it would be:
SideMenuManager.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar).isEnabled = false
SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view).isEnabled = false
@aco314 as noted in my guidelines for contributing, I am not a teacher. I recommend searching or posting on stackoverflow.com, or reading up on Apple's documentation for further assistance. Good luck!
@aco314 I have the some problem as you. the following is helpful for me:
in viewController which setup SideMenu,
fileprivate var recognizers: [UIScreenEdgePanGestureRecognizer]?
override func viewDidLoad()
{
// something init
recognizers = SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
}
override func viewWillAppear(_ animated: Bool)
{
super.viewWillAppear(animated)
recognizers?.forEachEnumerated { (_, recognizer) in
recognizer.isEnabled = true
}
}
override func viewWillDisappear(_ animated: Bool)
{
super.viewWillDisappear(animated)
recognizers?.forEachEnumerated { (_, recognizer) in
recognizer.isEnabled = false
}
}
good luck!
Most helpful comment
@aco314 I have the some problem as you. the following is helpful for me:
in viewController which setup SideMenu,
good luck!