Sidemenu: Push ViewController to left menu cause pushing it to main view

Created on 20 Sep 2017  路  3Comments  路  Source: jonkykong/SideMenu

New Issue Checklist


I have read the guidelines for contributing and I understand:

  • [x] My issue is happening in the latest version of SideMenu.
  • [x] My issue was not solved in the README.
  • [x] My issue can not be answered on stackoverflow.com.
  • [x] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
  • [ ] My issue is reproducible in the demo project.

Issue Description

On left menu I have ViewController with button which should show another ViewController inside left menu. So inside my LeftMenuViewController do:

    self.navigationController?.pushViewController(leftMenuDetailsVC, animated: true)

However it pushes VC to mainNavigationController not leftMenuNavigationController

    SideMenuManager.menuLeftNavigationController?.pushViewController(leftMenuDetailsVC, animated: true)

works the same way.

How can I push VC to left menu?

All 3 comments

Please read the README carefully.

@szooky Curious if you managed to get it working?

@szooky @spinach

SideMenuManager.default.menuPushStyle = .subMenu

/**
The push style of the menu.
There are six modes in MenuPushStyle:

  • defaultBehavior: The view controller is pushed onto the stack.
  • popWhenPossible: If a view controller already in the stack is of the same class as the pushed view controller, the stack is instead popped back to the existing view controller. This behavior can help users from getting lost in a deep navigation stack.
  • preserve: If a view controller already in the stack is of the same class as the pushed view controller, the existing view controller is pushed to the end of the stack. This behavior is similar to a UITabBarController.
  • preserveAndHideBackButton: Same as .preserve and back buttons are automatically hidden.
  • replace: Any existing view controllers are released from the stack and replaced with the pushed view controller. Back buttons are automatically hidden. This behavior is ideal if view controllers require a lot of memory or their state doesn't need to be preserved.
  • subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu. Use this behavior if you want to display a sub menu.
    */
    open var menuPushStyle: MenuPushStyle = .defaultBehavior
Was this page helpful?
0 / 5 - 0 ratings