Closed mEldewaik closed 4 years ago
@mEldewaik You can't push a controller from the presented view controller. So make sure your main view controller which is going to show your side menu view controller should be embedded in a Navigation controller.
This piece of code works fine because the navigation controller is embedded in window
` self.window = UIWindow.init(frame: UIScreen.main.bounds)
let navigationController = UINavigationController.init()
let mainView = UIStoryboard.init(name: UserManager.isLoggedIn ? "Main" : "Login",
bundle: Bundle.main).instantiateInitialViewController()!
navigationController.viewControllers = [mainView]
self.window?.rootViewController = navigationController`
Without the navigation controller as root, I can experience the same issue as you described
` self.window = UIWindow.init(frame: UIScreen.main.bounds)
let mainView = UIStoryboard.init(name: UserManager.isLoggedIn ? "Main" : "Login",
bundle: Bundle.main).instantiateInitialViewController()!
self.window?.rootViewController = mainView
`
Please follow the README instructions carefully.
Stuck hours with this, give us a real example with the storyBoard please
what if I got a login screen and want to redirect user if hes signed in directly to the main screen (the vc that present the sideMenu) ?
I have read the guidelines for contributing and I understand
Describe the bug A clear and concise description of what the bug is. i have a sidemenu in my project it presented as expected. i have a button in my sidemenu and when i make push to new viewcontroller it pushed but in the viewcontroller of sidemenu
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen. i expect that the sidemenu disapeared and a new view controller pushed but i have the new viewcontoller in the same sidemenu controller
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.