Now, we need to get our map hooked up and get the annotations displayed on the map. Then, we will customize our annotations to look like those in our design.
Creating and adding annotations
Creating our Map View Controller
We need to create our MapViewController file and then connect it with our UIViewController and map view in the storyboard. First, let's create this file:
- In the Navigator panel, right-click on the Controller folder in the Map folder and select New File.
- In 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 to the Options screen that appears:
New file:
-
- Class: MapViewController
- Subclass: UIViewController
- Also create...