Adding a Tab Bar Controller
Master iOS Tab Bar Controllers and Navigation
What You'll Build
Tab Bar Navigation
Create a multi-tab interface for your Jive Factory app with seamless navigation between different views and features.
Custom Icons
Learn to implement both system-provided icons and custom graphics for professional-looking tab bar items.
Navigation Controller Integration
Connect existing navigation controllers with new tab bar controllers for complex app architectures.
Exercise Development Flow
Setup Tab Bar Controller
Add the main tab bar controller and configure basic structure
Connect Navigation Controllers
Link existing navigation controller to tab bar system
Configure Tab Icons
Set up Featured system icon and custom Map icon
Test Implementation
Run simulator to verify tab switching functionality
Alternative Setup Process
Access Starter Files
Navigate to the Class Files directory and locate the pre-configured Jive Factory Ready for Tab Bar Controller folder
Duplicate and Rename
Create a working copy of the starter project by duplicating and renaming the folder to Jive Factory
Open Project
Launch Xcode and open the Jive Factory.xcodeproj file from your newly created folder
Reduce the Editor zoom to 50% before adding the Tab Bar Controller. This large UI component requires adequate space for proper positioning and connection management.
Tab Bar Controller Components
Main Controller
The central tab bar controller that manages switching between different views and maintains the tab interface.
Default View Controllers
Two pre-connected view controllers labeled Item 1 and Item 2 that serve as starting points for your tabs.
Controller Connection Process
Remove Default Controllers
Delete the default Item 1 view controller and disconnect Item 2 to prepare for custom connections
Connect Navigation Controller
Control-drag from the Tab Bar Controller to your existing Navigation Controller to establish the first tab
Link Second Tab
Create a segue connection between the Tab Bar Controller and the Item 2 controller for the second tab
Icon Types Comparison
| Feature | System Icons | Custom Icons |
|---|---|---|
| Setup Difficulty | Simple dropdown selection | Requires asset import |
| Visual Consistency | Matches iOS standards | Unique branding opportunity |
| Customization Level | Limited to Apple designs | Full creative control |
| File Management | No additional files needed | PNG-24 assets required |
Custom tab bar icons should be black on transparent background and saved as PNG-24. iOS automatically applies color fills and selection states to black areas of the image.
Custom Icon Implementation
Import Assets
Add icon files to Assets.xcassets by dragging them from the Icons folder in Class Files
Configure Tab Properties
Set the tab title to Map and select locationIcon from the Image menu in Attributes inspector
Update Initial View Controller
Drag the gray arrow from Navigation Controller to Tab Bar Controller to set proper app entry point
The blue highlighting of selected tab icons is handled automatically by iOS. The tab bar system applies appropriate colors to your black icon areas without additional programming.
Key Takeaways






