Passing data to restaurant  detail

In the next chapter, we are going to display the data in our restaurant detail. For now, we want to pass the data over to the detail view.

To make this work, we need to update both our RestaurantDetailViewController (which we have not created yet) and the MapViewController. Let's create the RestaurantDetailViewController:

  1. Right-click on the new Restaurant Detail and select New File.
  2. In the Choose a template for your new file screen, select iOS at the top and then Cocoa Touch Class. Then, hit Next.
  3. In the Options screen, add the following:

New file:

    • Class: RestaurantDetailViewController
    • Subclass: UITableViewController
    • Also create XIB: Unchecked
    • Language: Swift
  1. Click Next and then Create.
  2. Delete everything ...

Get iOS 12 Programming for Beginners - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.