Video: Build a navigation app for iOS
Familiarity with Xcode and Swift
The Mapbox Navigation SDK for iOS gives you all the tools you need to add turn-by-turn navigation to your iOS app. You can get up and running in a few minutes with our drop-in navigation view controller, or build a completely custom app with our core components for routing and navigation.
In this video, we'll show you how to install the Navigation SDK, import it into an iOS app, request directions between two predefined waypoints, and show the navigation UI using simulated real-time location in Xcode.
Getting started
- 0:00 - Take a quick look at the Navigation SDK Documentation Guide
Install the Navigation SDK
- 0:22 - Create a new access token with
DOWNLOADS/READ
private scope - 0:37 - Create a
.netrc
file using the new access token and save it in your user directory - 2:27 - Create a new Xcode project
- 3:12 - Create a new access token with public scopes
- 4:15 - Add the public access token to your project's
info.plist
- 4:46 - Install the Navigation SDK from source (via GitHub)
Add a map and display a route
- 6:55 - Import
MapboxMaps
and add a MapView to the main view controller - 8:15 - Import
MapboxDirections
, configureRouteOptions
- 9:45 - Request a route from the Mapbox Directions API
- 10:55 - Import
MapboxNavigation
and use aNavigationMapView
andshowcase()
to display the route
Add live turn-by-turn navigation
- 14:02 - Create a
NavigationViewController
- 15:38 - Add
NSLocationWhenInUseUsageDescription
toInfo.plist
(see our suggested language) - 16:47 - Add the
Audio, Airplay, and Picture in Picture
background mode to your app - 18:08 - See the Navigation in action using the iOS Simulator's location simulation (set to 'Freeway Drive')
Next steps
There are many other ways you can customize the Mapbox Navigation SDK for iOS beyond what you've done in this tutorial. For a complete reference of customization options see the Navigation SDK for iOS documentation. Options include:
- Walking and cycling modes.
- Delivering voice instructions using third-party speech synthesizer.
- Building a custom turn-by-turn experience using Core Navigation.