Next, since we're using Swift, you'll need to create a bridging header by creating a new Objective-C file (empty file) in the project and answering "Yes" to "Would you like to configure an Objective-C bridging header?" In the Project Name-Bridging-Header.h file that was just created, add:

#import <UIKit/UIKit.h>#import "Mapbox.h"

Now, in your ViewController.swift (or wherever you choose), make sure your class is a RMMapViewDelegate.

Of course here you will put in your own coordinates, title, and subtitle. userInfo is a handy place to put any other information you might want, i.e. categories that the icon will be based on. E.g. "company" would have one icon and "park" would have another.

Now is when the delegate action comes in, so make sure you included RMMapViewDelegate at the beginning of your file. Let's add the function that will create a layer for each of our annotations. If you only have one image for your markers, you can use this code: