Search code examples
objective-ciosuiviewcontrolleruitabbaruitabbaritem

Selection of UITabBarItem loading corresponding view


I have a UIViewController named "RootViewController" which contains a UITableView and a UITabBar (2 TabBarItems - Favorites and More). When the View is being displayed, the TableView and TabBar are visible. Now I want to load an additional view when pressing the other TabBarItem (More). And backwards, but the tabbar should be available. (User can press Favorites)

How can this be done?

BR, mybecks


Solution

  • If you want the UITabBar to be visible on more than one screen you should use a UITabBarController. That controller should hold your different UIViewController.
    It's wheel explain in the documentation on how to implement that controller.