So far, you have added and connected the outlets for the Restaurant Detail screen inside RestaurantDetailViewController. You've also added code to get restaurant data from a RestaurantItem instance and used it to populate the outlets. The last thing you need to do is pass the selected RestaurantItem instance from RestaurantListViewController to RestaurantDetailViewController.
To do this, do the following steps:
- Click RestaurantListViewController.swift in the Project navigator.
- Add the following code under viewDidLoad():
override func prepare(for segue:UIStoryboardSegue, sender:Any?) {
if let identifier = segue.identifier {
switch identifier {
case Segue.showDetail.rawValue:
showRestaurantDetail(segue:segue)
default:
print("Segue not added...