iOS Setup

Prerequisites

SDK Configuration

The AirMapSDK-Swift library reads a JSON configuration file during initialization. This airmap.config.json file can be downloaded from the AirMap Developer Portal and placed in the root of the project's app bundle.

Mapbox Api Key

AirMap provides AirMapMapView, which exposes methods that allow you to contextually configure the map. AirMapMapView is a subclass of MGLMapView, which is provided by the Mapbox SDK. Please sign up and request a Mapbox access token: https://www.mapbox.com/ios-sdk/#access_tokens

You can add this access token to your airmap.config.json.

Dependencies

The AirMapSDK-Swift library and its dependencies are available via CocoaPods or Carthage.

๐Ÿšง

Always check the Github repo for the latest release versions: SDK Releases

CocoaPods

The CocoaPods version is broken down into various subspecs including AirMapSDK/Core, AirMapSDK/Traffic, AirMapSDK/Telemetry, and AirMap/UI. To install all components, use AirMapSDK.

pod 'AirMapSDK'

Carthage

To install the iOS SDK using Carthage dependency management add the following to your Cartfile:

github "airmap/AirMapSDK-Swift"

Importing Library

To use the AirMap SDK within your code, add the following import statement:

import AirMap

Example Application

An example iOS app is available in the AirMapSDK-Swift repository.

Example App Setup

Clone Repo

$ git clone https://github.com/AirMap/AirMapSDK-Swift.git
$ cd AirMapSDK-Swift

Install Dependencies

$ cd Example
$ pod install

Open the project

$ open AirMapSDK.xcworkspace

Configure AirMap

Download your application's airmap.config.json file from the AirMap Developer Portal and set the Mapbox access token.

Add the configuration file to the root of the project.

Updated 2 years ago

iOS Setup


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.