Displaying data in the static table view
You have successfully connected all the outlets in the RestaurantDetailViewController
class to the user interface elements in the Restaurant Detail screen. Since this is a static table view, you won't be adopting the UITableViewDataSource
protocol to populate the outlets. Instead, you will write custom methods to do so. Follow these steps:
- Click the
RestaurantDetailViewController
file in the Project navigator. - Add code to import the
MapKit
framework after the existingimport
statement:import MapKit
This is required since you will be using the MapKit
framework's properties and methods to generate an image of a map for the image view in the last cell.
- Add a private extension containing code to set the labels in the Restaurant Detail screen after the last curly brace:
private extension RestaurantDetailViewController { func setupLabels() { guard let restaurant...