Commit 723ef9fa by M. Porooshani

Returned to new way to handle menu show/hide functionality

parent cb15b04c
......@@ -97,6 +97,22 @@ class AppMenuController: MenuController {
openMenu()
}
}
/// Shows the menuView.
func showMenu() {
menuView.animate(MaterialAnimation.animationGroup([
MaterialAnimation.rotate(rotation: 3),
MaterialAnimation.translateY(0)
]))
}
/// Hides the menuView.
func hideMenu() {
menuView.animate(MaterialAnimation.animationGroup([
MaterialAnimation.rotate(rotation: 3),
MaterialAnimation.translateY(150)
]))
}
/// Prepares the menuView.
private func prepareMenuView() {
......
......@@ -77,16 +77,14 @@ class ItemViewController: UIViewController {
sideNavigationController?.enabled = false
// Stops the scrollView contentInsets from being automatically adjusted.
automaticallyAdjustsScrollViewInsets = false
(menuController as? AppMenuController)?.hideMenu()
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
// Access the navigationItem.backButton here.
// navigationItem.backButton
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
(menuController as? AppMenuController)?.showMenu()
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
......
......@@ -73,10 +73,7 @@ class RecipesViewController: UIViewController {
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
// Show the menuView.
menuController?.menuView.animate(MaterialAnimation.animationGroup([
MaterialAnimation.rotate(rotation: 3),
MaterialAnimation.translateY(0)
]))
}
override func viewWillDisappear(animated: Bool) {
......@@ -84,10 +81,7 @@ class RecipesViewController: UIViewController {
// Disable the SideNavigation.
// Hide the menuView.
menuController?.menuView.animate(MaterialAnimation.animationGroup([
MaterialAnimation.rotate(rotation: 3),
MaterialAnimation.translateY(150)
]))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment