Set Up Your Environment
Now that you have taken care of all the preliminary issues, we can start building the app. Throughout this guide, you will continously modify this project to extend its functionality to cover a number of basic features.
Create an Xcode Project
We recommend using Xcode for following along. For this guide we will be using Xcode 26. Note that an iOS mobile device is not required, as Xcode allows the use of a simulator.
We start off by creating an Xcode project using the App template:

For the project settings, you can call it anything you like, however ensure the following settings are set to follow along easier:
Interface: Storyboard
Language: Swift

You should now have a project folder with the following files:

Installing the MapsIndoors SDK
MapsIndoors can be installed using Swift Package Manager or CocoaPods.
Open your Xcode project or workspace, then go to File > Add Packages Dependencies....
In the search bar in the top right corner, enter
https://github.com/MapsPeople/mapsindoors-mapbox-ios.git(to use Mapbox Maps)or
https://github.com/MapsPeople/mapsindoors-googlemaps-ios.git(to use Google Maps)Select the Dependency Rule you want to apply to the MapsIndoors SDK
A common choice for Dependency Rule is "Up to Next Major Version", specifying
4.18.0as the minimum version. To instead install a specific version set the Dependency Rule field to "Exact Version" and insert the desired version. The latest version of the MapsIndoors SDK is4.18.0.
Hit enter or Click Add Package.
In the new window select the
MapsIndoorsMapboxorMapsIndoorsGoogleMapslibrary and click Add Package. Once SPM finishes installing the SDK you will see 3 new dependencies under Package Dependencies:MapsIndoors,MapsIndoorsCore, andMapsIndoorsMapboxorMapsIndoorsGoogleMaps(plus their respective dependencies).Click on your project's target, scroll down to
Frameworks, Libraries, and Embedded Contentand click the plus button.From the list select
MapsIndoorsMapboxorMapsIndoorsGoogleMapsand click add.
Now you can use start using MapsIndoors in your project by using import MapsIndoors in your source code.
Create a new
Podfilein your project directory (same folder as your .xcodeproj) by runningpod init <XCODEPROJECTNAME>in Terminal.Add your dependecies to the
Podfileas follows (replaceYOUR_APPLICATION_TARGET_NAME_HEREwith your actual target name),
Save the
Podfileand close Xcode.Open a terminal in the directory of the project.
cd <path-to-project>Run
pod installin the terminal.From this time onwards, use the .xcworkspace file to open the project.
Adding API Credentials
Open back up the project and navigate to the file AppDelegate.swift.
Add the following import statements to the top of the file:
Insert the following into the
application(_:didFinishLaunchingWithOptions:)method. If you are usingMapboxthen provide your API Key when you add your map to the view insideviewDidLoad()in yourViewController.swift:
Finally, remember to replace YOUR_MAPBOX_API_KEY with your Mapbox Access Token and YOUR_MAPSINDOORS_API_KEY with your MapsIndoors API key (or use the demo key mapspeople3d).
Add the following import statements to the top of the file:
Insert the following into the
application(_:didFinishLaunchingWithOptions:)method. If you are usingMapboxthen provide your API Key when you add your map to the view insideviewDidLoad()in yourViewController.swift:
Finally, remember to replace YOUR_GOOGLE_API_KEY with your Google API key.
Last updated
Was this helpful?