NavigationViewController

open class NavigationViewController : UIViewController, NavigationStatusPresenter, NavigationViewData
extension NavigationViewController: NavigationServiceDelegate
extension NavigationViewController: StyleManagerDelegate
extension NavigationViewController: TopBannerViewControllerDelegate
extension NavigationViewController: BottomBannerViewControllerDelegate
extension NavigationViewController: CarPlayConnectionObserver
extension NavigationViewController: NavigationMapViewDelegate

NavigationViewController is a fully-featured user interface for turn-by-turn navigation. Do not confuse it with the NavigationController class in UIKit.

You initialize a navigation view controller based on a predefined Route and NavigationOptions. As the user progresses along the route, the navigation view controller shows their surroundings and the route line on a map. Banners above and below the map display key information pertaining to the route. A list of steps and a feedback mechanism are accessible via the navigation view controller.

To be informed of significant events and decision points as the user progresses along the route, set the NavigationService.delegate property of the NavigationService that you provide when creating the navigation options.

CarPlayNavigationViewController manages the corresponding user interface on a CarPlay screen.

  • Initializes a NavigationViewController that presents the user interface for following a predefined route based on the given options.

    The route may come directly from the completion handler of the MapboxDirections framework’s Directions.calculate(_:completionHandler:) method, or it may be unarchived or created from a JSON object.

    Declaration

    Swift

    required public init(for route: Route, routeIndex: Int, routeOptions: RouteOptions, navigationOptions: NavigationOptions? = nil)

    Parameters

    route

    The route to navigate along.

    routeIndex

    The index of the route within the original RouteResponse object.

    routeOptions

    The route options used to get the route.

    navigationOptions

    The navigation options to use for the navigation session.