Adding a table view to the Locations screen
When you tap the button in the collection view section header of the Explore screen, another view representing the Locations screen will be presented modally, but it is currently blank. Let's add a table view to this view. Follow these steps:
- Build and run the
LetsEat
app to make sure everything still works as it should. ClickMain.storyboard
in the Project navigator. In the document outline, select the View Controller icon in View Controller Scene presented modally by the button under Explore View Controller Scene. Click the Library button:Figure 11.1 – Toolbar with the Library button shown
- Type
table
in the filter field. A Table View object will appear in the results. - Drag the Table View object to the view in the view controller scene:
Figure 11.2 – Library with the Table View object selected
- You'll add constraints to make the table view take up the whole screen. With the table view selected, click...