Hi,
Firstly thanks for a great pod.
I have set up SideMenu in storyboard and it works nicely. I just have one issue where when you tap on an cell in the side menu it performs the push segue but the view controller is pushed on top of the current view controller, meaning you can tap back in the top left to return to the previous view controller.
So how would I make selecting a menu item replace the existing view controller, to essentially switch between the different view controllers? Something like this you would do normally:
setViewControllers([viewController], animated: false)
Thanks!
@joebenton You would need to subclass UISideMenuNavigationController or your main navigation controller's push method to perform the desired method.
This might be a decent feature to add to this repository as a property for people to switch on/off.
This is working for me:
if let nav = self.navigationController as? UISideMenuNavigationController,
let presentingNav = nav.presentingViewController as? UINavigationController {
dismiss(animated: true, completion: nil)
presentingNav.setViewControllers([<# Your View Controller #>], animated: false)
}
I implemented this in the root view controller of my left hand SideMenu.
Try the new menuReplaceOnPush property in version 2.0.7 of SideMenu.
i have tried the menuReplaceOnPush property but still not working...please help!
I didn't see menuReplaceOnPush in 'SideMenu', '~> 6.0'.
Any alternative option?
Most helpful comment
This is working for me:
I implemented this in the root view controller of my left hand SideMenu.