1

I use swift3 and MMDrawerController for creating slide menu.

the MMDrawerController codes are these, which are on appdelegate :

    let mainStoryBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)

    let homeViewController = mainStoryBoard.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController
    let cartViewController = mainStoryBoard.instantiateViewController(withIdentifier: "CartViewController") as! CartViewController
    let menuViewController = mainStoryBoard.instantiateViewController(withIdentifier: "MenuVCGuest") as! MenuVCGuest

    let leftSideNav = UINavigationController(rootViewController: cartViewController)
    let centerNav = UINavigationController(rootViewController: homeViewController)
    let rightSideNav = UINavigationController(rootViewController: menuViewController)

    centerContainer = MMDrawerController(center: centerNav, leftDrawerViewController: leftSideNav, rightDrawerViewController: rightSideNav)

Everything works fine and I can navigate to some other ViewControllers from slide menu... but if I navigate to a ViewController from another UINavigationController and come back to Main page of App (Root_View), The slide menu buttons from navigationbar does not work anymore...

I created multiple UINavigationController to open new pages in full Screen view not as sub view of a navigation process...

enter image description here

So with separating the UINavigationControllers, the slide menu buttons on main page navigation bar stops working!

what should I do now?

Sorry for my poor english...

Ahmadreza
  • 6,950
  • 5
  • 50
  • 69
  • I think your root navigation controller is changed when you move to other view controllers. So please check that when you come to your main view controller which navigation controller is your root. – Jitendra Modi Jan 27 '17 at 10:54
  • Thanks, but how can I chek that ?! I use this code to navigate to my Root_View : ==== > let nextViewController = storyBoard.instantiateViewController(withIdentifier: "Root_View") as UIViewController – Ahmadreza Jan 27 '17 at 11:29
  • 1
    you can get hierarchy of your all view controllers along with navigation controllers from " navigationcontroller.viewcontroller " – Jitendra Modi Jan 27 '17 at 11:35
  • I tried to reset the Root_View but that didn't changed the result. – Ahmadreza Jan 27 '17 at 15:23

0 Answers0