Next, we need to create a method that will display all of our data in our labels.
Open the RestaurantDetailViewController.swift file and add the private extension after the last curly brace:
private extension RestaurantDetailViewController {
func setupLabels() {
guard let restaurant = selectedRestaurant else { return }
if let name = restaurant.name {
lblName.text = name
title = name
}
if let cuisine = restaurant.subtitle { lblCuisine.text = cuisine }
if let address = restaurant.address {
lblAddress.text = address
lblHeaderAddress.text = address
}
lblTableDetails.text = "Table for 7, tonight at 10:00 PM"
}
}
This method will now get the data and display it inside our labels. Next, we want to display a map of the restaurant...