BTNavigationDropdownMenu
BTNavigationDropdownMenu copied to clipboard
Dismiss Menu when changing views
Thank you for this great menu. It works very well.
My only issue is I use it in "ViewController2". When the menu is displayed, the user can push the "back" button to unwind to "ViewController1", and the menu remains the displayed in "ViewController1"
It does not cause any crashes or generate errors/warnings. It just looks odd.
Thank You Again, Paul
+1
Same problem here. So, I'm calling "menuView.hideMenu()" on viewWillDisappear.
You also need to change the hideMenu() method to public before you can use it on menu view
please try this.
// class BTNavigationDropdownMenu // isShown: private -> public public var isShown: Bool! = false
// ViewController2 @IBAction func backButtonTouched(sender: AnyObject) { print(menuView.isShown) if !menuView.isShown { print("backButtonTouched") // code actions...
}
}
None of these solutions working for me. I get, fatal error: unexpectedly found nil while unwrapping an Optional value. on both isShown and .hideMenu()
Tried making isShown and hideMenu() public. And tried in viewWillDisappear and willMoveToParentController.
@TheBogueRat @John-Connolly I made showMenu() and hideMenu() public so that you guys can control behavior of dropdown menu more flexible :)
Please feel free to reopen this if you guys have same issue.
I have the same problem "fatal error: unexpectedly found nil while unwrapping an Optional value" when i want to use menuView.hideMenu() in my back button (UIBarButtonItem) :/
And none of these solutions working for me :s
Any ideas ?
@ins0u make sure menuView didn't be deallocated before using menuView.hideMenu(). Putting menuView.hideMenu() in viewDidDisappear(_:) is one of the reasons might cause the crash.
I think it deallocated, because menuView = nil :/ but how fix that ?
What moment it was deallocated ?