SideMenu Functionality in swift 4

1.4k Views Asked by At

I am setting up the side menu by following SideMenu

When the app is loaded first the side menu controller is working fine (.menuslide)

but when I come back to the same controller from the side menu to the same view controller or any other controller or any other page it is not following (.menuslide)

  1. I have tried by assigning the navigation

    let menu = SideMenuNavigationController(rootViewController: YourViewController)
    let rightMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController) 
    SideMenuManager.default.rightMenuNavigationController = rightMenuNavigationController
    present(menu, animated: true, completion: nil) 
    

through code and also

  1. From the story board

    I am navigating from every controller to side menu like this

     let navigationController = storyboard!.instantiateViewController(withIdentifier: "sidemenunavigation") as! SideMenuNavigationController present(navigationController, animated: true, completion: nil)
    

for the first time after loading it is navigating properly (.menuslide)

but after navigating to other controller and get the side menu it is not following (.menuslide)

2

There are 2 best solutions below

3
Awais Mobeen On

you may use the following RESideMenu for side menu quite easy to use RESideMenu for side menu

0
Mahesh Butani On

please check this code is working fine for navigation another view controller for sidemenu

let storyBoard = UIStoryboard(name:"Main", bundle: nil)
            if let conVC = storyBoard.instantiateViewController(withIdentifier: "RoutingAddViewController") as? RoutingAddViewController,
               let navController = UIApplication.shared.keyWindow?.rootViewController as? UINavigationController {
                navController.pushViewController(conVC, animated: true)
            }