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:
- In the Navigator panel, right-click on the
Controller
folder in theMap
folder and select New File. - Inside of the Choose a template for your new file screen, select iOS at the top and then Cocoa Touch Class. Then, hit Next.
- Add the following into the options screen that appears:
- New File:
- Class:
MapViewController
- Subclass…:
UIViewController
- Also create XIB: Unchecked
- Language ...
- Class:
Get iOS 10 Programming for Beginners 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.