Creating and adding annotations

Now, we need to get our Map hooked up and start getting the annotations displaying on the Map. Then, we will customize our annotations to look like those in our design.

Creating our Map View Controller

We need to create our Map View Controller file and then connect it with our UIViewController and Map View in Storyboard. First, let's create this file:

  1. In the Navigator panel, right-click on the Controller folder in the Map folder and select New File.
  2. Inside of the Choose a template for your new file screen, select iOS at the top and then Cocoa Touch Class. Then, hit Next.
  3. Add the following into the options screen that appears:
  4. New File:
    • Class: MapViewController
    • Subclass…: UIViewController
    • Also create XIB: Unchecked
    • Language ...

Get iOS 10 Programming for Beginners now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.