Closed TNikolai closed 8 years ago
If you are using the latest version. There are enable properties you can set.
For example
navigationDrawerController?.enabledLeftPanGesture = false
and so forth. Give those a try, and let me know how it goes. Thank you!
I use version 1.39 and in this version i have not this property : navigationDrawerController. .
Yes currently Material is at version 1.42.7. I believe I added the enable handler in 1.40.*. Personally I would update to the latest. So many fixes have been made.
The NavigationDrawerController is the new name for the SideNavigationController.
Mhm now i installed new pod version and i see enabledLeftPanGesture.
So it solved issue! thx.
:) awesome! Thank you
Hi danieldahan, my problem was solved particulary, i saw very strange bug in my app when i download app at first launch bug appears, if i press homeButton and again open app leftPanRecognizer not triggers. In both casses i verified code called : unwrappedSideNavigationController.enabledLeftPanGesture = enabled unwrappedSideNavigationController.enabledLeftTapGesture = enabled
If you have that code in the viewDidLoad it won't fire because it is not a child of the NavDrawer. Put it in the viewWillAppear or viewDidAppear method. Or possibly you should share your setup code for that area.
override func viewDidDisappear(animated: Bool) {
super.viewDidDisappear(animated)
LeftMenuWireFrame.enableLeftSideMenu(false)
}
class func enableLeftSideMenu(value: Bool) { if let appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate { appDelegate.appFlow.homeModule.enableLeftSideMenu(value) } }
func enableLeftSideMenu(enabled: Bool) { if let unwrappedSideNavigationController = sideNavigationController { unwrappedSideNavigationController.enabledLeftPanGesture = enabled unwrappedSideNavigationController.enabledLeftTapGesture = enabled } }
i call this method in viewDidDisapear and i verified in debuger it all time entered in all if's.
I need to see the setup code. How are you adding the view controllers to the NavigationDrawer, also, what are you enabling and disabling the panning for, could the other parts using pan be causing an issue. Also as a tip, you can simplify these lines
unwrappedSideNavigationController.enabledLeftPanGesture = enabled
unwrappedSideNavigationController.enabledLeftTapGesture = enabled
to
unwrappedSideNavigationController.enabledLeftView = enabled
I verified and in my initializatiin code i have initializing SideNavigation(root: NavigationController(homeVc), leftMenuController, nil). I think problem in initializing root like navigation controller. All child viewControllers of NavigationController(homeVc) responds to leftPanRecognizer. I need some how on specified childController to disable leftPanGesture.
Yes, you could put in the viewWillAppear a disable or enable call.
There is a helper optional property navigationDrawerController?.enableLeftGesture
that you can use in any child view controller. This includes deep hierarchal view controllers.
pod 'Material', '~> 1.41' And i have only SideNavigationController class, so i have not controller or property named : "navigationDrawerController".
@TNikolai update the pod to the latest version!
My current version Using Material (1.41.1) pod 'Material', '~> 1.4' which version i need to use ?
1.42.7
So i updated pods and all works fine, thx a lot.
The problem caused by enabled gesture recognizers from sideNavigation, I pushed new one viewController on which i have priceRange when i want swipe I cant because gestures was catched by Sidenavigation.
I resolved this on local version setting two methods from private to public
public func prepareGestures() { if nil == panGesture { panGesture = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture)) panGesture!.delegate = self view.addGestureRecognizer(panGesture!) }