- Developing with Navigation Controllers and Split Views
- Recipe: Building a Simple Two-Item Menu
- Recipe: Adding a Segmented Control
- Recipe: Navigating Between View Controllers
- Recipe: Presenting a Custom Modal Information View
- Recipe: Page View Controllers
- Recipe: Scrubbing Pages in a Page View Controller
- Recipe: Tab Bars
- Recipe: Remembering Tab State
- Recipe: Building Split View Controllers
- Recipe: Creating Universal Split View/Navigation Apps
- Recipe: Custom Containers and Segues
- One More Thing: Interface Builder and Tab Bar Controllers
- Summary
One More Thing: Interface Builder and Tab Bar Controllers
Xcode offers easy-to-customize tab bar instances that get you started building tab-bar-based GUIs in Interface Builder. By default, this object creates two child view controllers in the storyboard. You can expand this basic presentation by adding new view controllers to the tab bar controller and/or setting classes using the identity inspector (see Figure 5-9).
Figure 5-9 Interface Builder storyboards provide tools for laying out tab bar controllers, simplifying laying out what is essentially a logical and not a visual class, compared to what previous versions of Xcode allowed.
You'll likely want to create a new view controller class for each tab, to allow each tab to offer a separate and meaningful function. To add art to the tabs in IB, drag 20x20 PNG images from the Library > Media pane onto each tab button, as shown mid-drag in Figure 5-10, or set the art using the tab bar item's attribute inspector. The Media pane lists the images you have added to your Xcode project. Design your images using a transparent background and a white foreground.
Figure 5-10 Drag art from the media library directly onto the tab bar item shown below each child view controller.
Interface Builder's new storyboards offer a friendly way to both lay out individual view controllers and connect them to their parents. This is a vast change from previous versions of Xcode, where many developers found themselves forgoing IB to design and deploy tab bars and navigation bars in code.