Reputation: 61
I have a container view inside of a view controller and I want to switch the view controller in the container view when a button is pressed in the main view. Any suggestions? Also if it is possible I would prefer swift if you give any examples. Thanks
Upvotes: 0
Views: 435
Reputation: 2751
If you have not started your work yet I would suggest using UITabViewController
in place of container view in UIViewController
. Using UITabViewController
has one advantage over using container view that you dont have to manage Child View Controller your UITabViewController
manages it all. As apple documentation says UITabBarController
is a specialized view controller that manages a radio-style selection interface.
But if you have already started working on container view, you may want it working.I too learned regarding container view from the same link which @iOSGeek has shared. Every things is clearly explained. You can follow the same link and you are good to go.
Hope it helps. Happy Coding!!
Upvotes: 1