UINavigationController / UITabBarController
Twitter Slide Out Menu
One last piece of functionality I want to show you how to implement is the ability to use container controllers in your project. These containers include UINavigationController and UITabBarController. It's very important that you understand how to set this up as your applications will not be very useful unless you wrap your view controllers in the proper container controllers.

Comments (7)
Mo Tiv
4 years ago
hey brian, amazing tutorials! i have a question. in my navigation controller (home controller) navigation bar i have a searchcontroller, and while the searchbar is active (keyboard is open) how would i disable the pan gesture? thanks for your videos, i gotta say again, amazing!! - khalil
Doc
4 years ago
Hello! How can i do a navigation push from the menu?
Brian Voong
4 years ago
Doc
4 years ago
I try this but don't work for me.
Brian Voong
4 years ago
Doc
4 years ago
Thanks. This works. If i use UITabController and UINavigationController the correct form for pushView is this? ((rigthViewController as? UITabBarController)?.selectedViewController as? UINavigationController)?.pushViewController(PruebasController(), animated: true)
Joe Langenderfer
4 years ago
Hey Brian, Whenever I scroll a little bit down my table view (filled with custom table view cells), then swipe for the menu, my table view slides way up. Basically, the moment I begin my swipe causes my home table view to shoot up. Any idea why this is? To me, it seems like the red view (with my home table view in it) isn't constraining to the bottom once I begin the pan gesture, however, my code in the Base Sliding VC essentially perfectly replicates yours. Thanks!
Joe Langenderfer
4 years ago
Hey Brian - This problem got solved in the next video. Thanks!
nikosm
4 years ago
Hello, I am using a navigation controller from storyboard in which I have my HomeViewController. I have an action on a nav bar item to trigger the slide out menu to open. But with the code "(UIApplication.shared.keyWindow?.rootViewController as? BaseSlidingController)?.openMenu()" it gives me nil and I can't open the menu. Do you have any other way to open in this case? Thanks a lot!!!
nikosm
4 years ago
I mean that I have an other root vc in window
sbedx4
4 years ago
I need some assistance on this too. I can not get this to work.
nikosm
4 years ago
I found solution on this
sbedx4
4 years ago
What is it? Do you know how when you select the row, instead of creating a new view for separate results, dismiss the slider and and look for that key word in the home controller.
sbedx4
4 years ago
I couldnt find a fix, can you post yours?
nikosm
4 years ago
Give me your email here and I will send y
sbedx4
4 years ago
sbedasee@bucs.fsw.edu You can’t post it here.
jiarongkoh
4 years ago
Hi Brian, not too sure if you have tested this, but I noticed that if a collectionView is embedded as the mainView in the baseSlidingController, the collectionViewCell sizes will not resize itself correctly when the device rotates. I have tested it without embedding it onto a baseSlidingController and the resizing works correctly as intended. I have posted this question on SO, appreciate if you could take a look pls, thanks. https://stackoverflow.com/questions/55144433/swift-uicollectionviewcell-does-not-resize-correctly-when-rotated
tsangaris
4 years ago
Hi guys, For some reason when I select a menu item for the first time, then I see the rightViewController view and the darkCoverView to be removed from the superview with a very fast animation starting from the center of the superview and ending at the left-top corner. After that, when I select a menu item, the darkCoverView is never displayed again. And this makes sense since the darkCoverView is removed so it cannot bringSubviewToFront(). ps: this is not the same issue you tackled when you moved closeMenu() underneath the performRightViewCleanUp() call. Any ideas?
tsangaris
4 years ago
Found the problem! I was pinning the darkCoverView on the homeView instead on the redView! Took 1 day to figure it out! :)
Juan Gil
4 years ago
Hi Brian, Very good course. It has been very instructive for me. I have a question related with the UINavigationController. Can we make a push from the menu to a new Navigation Controller and then come back to the menu with the back button of the new NavigationBar?. I need to push a new view controller but not above the red view but in a new window. I think that to make a push from this menu we need to content it in a NavigationController. Thanks.
HELP & SUPPORT