I have left menu in my app and no right menu
After first init everything is OK, but after I close menu with this method
public func changeMainViewController(mainViewController: UIViewController, close: Bool)
I cannot open menu with swipe (only button)
I suppose that reason is the method
public func changeMainViewController(mainViewController: UIViewController, close: Bool)
in line 642
at that line we are closing right menu although there is no right menu
so in the method
public func closeRightWithVelocity(velocity: CGFloat)
we change frame of the rightContainerView and after this change method
public func isRightOpen() -> Bool
will return true cause rightContainerView.frame.size.width == 0 and rightContainerView.frame.origin.x == CGRectGetWidth(view.bounds)
and so method func handleLeftPanGesture(panGesture: UIPanGestureRecognizer) will return at line 327
I offer fix of this issue like this
public func changeMainViewController(mainViewController: UIViewController, close: Bool) {
removeViewController(self.mainViewController)
self.mainViewController = mainViewController
setUpViewController(mainContainerView, targetViewController: mainViewController)
if (close) {
if leftContainerView.frame.width > 0 {
closeLeft()
}
if rightContainerView.frame.width > 0 {
closeRight()
}
}
}
I have left menu in my app and no right menu After first init everything is OK, but after I close menu with this method
public func changeMainViewController(mainViewController: UIViewController, close: Bool)
I cannot open menu with swipe (only button)I suppose that reason is the method
public func changeMainViewController(mainViewController: UIViewController, close: Bool)
in line 642 at that line we are closing right menu although there is no right menuso in the method
public func closeRightWithVelocity(velocity: CGFloat)
we change frame of the rightContainerView and after this change methodpublic func isRightOpen() -> Bool
will returntrue
causerightContainerView.frame.size.width == 0
andrightContainerView.frame.origin.x == CGRectGetWidth(view.bounds)
and so method
func handleLeftPanGesture(panGesture: UIPanGestureRecognizer)
will return at line 327I offer fix of this issue like this