Creating a restaurant annotation

Before we jump into creating our file, we should first look at the data that we will be using. The data for the map view will be the same data that we use for our restaurant-listing page. Let's take a look at what the restaurant data will look like in plist format:

We need to create a file to represent this data for the map view, which will differ from the restaurant-listing page because we need to subclass MKAnnotation. Let's get started by creating this file now:

  1. Right-click on the Map folder and create a new group called Model. Then, right-click this folder and select New File.
  2. In the Choose a template ...

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.