Setting up a tab bar controller scene
As you saw in the app tour, the Let's Eat app has a tab bar with two buttons at the bottom of the screen, which are used to display the Explore and Map screens. You will remove the existing view controller scene and ViewController.swift
file and add a tab bar controller scene with two buttons to your project. Follow these steps:
- Click
Main.storyboard
in the Project navigator:Figure 9.14 – Project navigator with Main.storyboard selected
- The contents of
Main.storyboard
appear in the Editor area. Click the Document Outline button to collapse the document outline if it is present. This gives you more room to work with:Figure 9.15 – Editor area with the Document Outline button shown
- Click the + button to open the library:
Figure 9.16 – Toolbar with the Library button shown
The library allows you to pick UI objects to be added to a scene.
- Type
tabbar
in the filter field. A Tab Bar Controller object will appear...