-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i push other viewcontroller in drawercontroller? #132
Comments
Hi! SiuyuenChow, I wondering the same, and i find out how to set a Push other views using a protocol. like this: protocol NavigationProtocol: class { 2- Use Your MenuView to set the protocol instance
weak var navigationProtocol: NavigationProtocol? 3- set the protocol instance to pass the view using mainView.. this is very tricky because we go to the app delegate and tell what view will control the protocol function, and this will be the MainViewController... so, we go to the appDelegate. I put code if you not using storyboards and of course if you use storyboards... its really the "same thing" I got this code on the app delegate... (NOT USING STORYBOARDS)
(USING STORYBOARDS)
4- at this point we got an error in the appdelegate because we don't have the protocol implemented on the MainView.. so, we go to the MainView, or better, create a file called ProtocolMainVew(or the name of the main view you have, like this ProtocolMainViewController) and do this. extension MainViewController: NavigationProtocol { 5-Using the procotol to push the views... let item = indexPath.row and that's all... but one thing I dont know how pop the views when I put the menu on the navigation buttons for each view I set in the menu, maybe with another protocol I guess, but with this the navigation always will be the MainView. if you find how pop the views if you put the menu in every view you call in the menuSide, please let me know, and cheers! |
HI @Yancerva: |
can you show how can I do that? using - NSNotification I guess? |
Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value: file project_name/KYDrawerController.swift |
How can i push other viewcontroller in drawercontroller?
The text was updated successfully, but these errors were encountered: