O'Reilly logo

iOS Programming: The Big Nerd Ranch Guide by Joe Conway, Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

UITabBarController

View controllers become more interesting when the user’s actions can cause another view controller to be presented. In this book, we will show you a number of ways to present view controllers. We’ll start with a UITabBarController to swap between instances of HypnosisViewController and TimeViewController.

UITabBarController keeps an array of UIViewControllers. It also maintains a tab bar at the bottom of the screen with a tab for each view controller in this array. Tapping on a tab results in the presentation of the view of the view controller associated with that tab.

In HypnoAppDelegate.m, create an instance of UITabBarController, give it both view controllers, and install it as the rootViewController of the window.

-​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required