CarPlayNavigationViewControllerDelegate

public protocol CarPlayNavigationViewControllerDelegate : AnyObject, UnimplementedLogging

The CarPlayNavigationViewControllerDelegate protocol provides methods for reacting to significant events during turn-by-turn navigation with CarPlayNavigationViewController.

  • Called when the CarPlay navigation view controller is about to be dismissed, such as when the user ends a trip.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewControllerWillDismiss(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                                    byCanceling canceled: Bool)

    Parameters

    carPlayNavigationViewController

    The CarPlay navigation view controller that was dismissed.

    canceled

    True if the user dismissed the CarPlay navigation view controller by tapping the Cancel button; false if the navigation view controller dismissed by some other means.

  • Called when the CarPlay navigation view controller is dismissed, such as when the user ends a trip.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewControllerDidDismiss(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                                   byCanceling canceled: Bool)

    Parameters

    carPlayNavigationViewController

    The CarPlay navigation view controller that was dismissed.

    canceled

    True if the user dismissed the CarPlay navigation view controller by tapping the Cancel button; false if the navigation view controller dismissed by some other means.

  • Called when the CarPlay navigation view controller detects an arrival.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                         shouldPresentArrivalUIFor waypoint: Waypoint) -> Bool

    Parameters

    carPlayNavigationViewController

    The CarPlay navigation view controller that has arrived at a waypoint.

    waypoint

    The waypoint that the user has arrived at.

    Return Value

    A boolean value indicating whether to show an arrival UI.

  • Tells the receiver that the final destination PointAnnotation was added to the CarPlayNavigationViewController.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                         didAdd finalDestinationAnnotation: PointAnnotation,
                                         pointAnnotationManager: PointAnnotationManager)

    Parameters

    carPlayNavigationViewController
    finalDestinationAnnotation

    The point annotation that was added to the map view.

    pointAnnotationManager

    The object that manages the point annotation in the map view.

  • Asks the receiver to return a LineLayer for the route line, given a layer identifier and a source identifier. This method is invoked when the map view loads and any time routes are added.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                         routeLineLayerWithIdentifier identifier: String,
                                         sourceIdentifier: String) -> LineLayer?

    Parameters

    carPlayNavigationViewController
    identifier

    The LineLayer identifier.

    sourceIdentifier

    Identifier of the source, which contains the route data that this method would style.

    Return Value

    A LineLayer that is applied to the route line.

  • Asks the receiver to return a LineLayer for the casing layer that surrounds route line, given a layer identifier and a source identifier. This method is invoked when the map view loads and any time routes are added.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                         routeCasingLineLayerWithIdentifier identifier: String,
                                         sourceIdentifier: String) -> LineLayer?

    Parameters

    carPlayNavigationViewController
    identifier

    The LineLayer identifier.

    sourceIdentifier

    Identifier of the source, which contains the route data that this method would style.

    Return Value

    A LineLayer that is applied as a casing around the route line.

  • Asks the receiver to return a LineLayer for highlighting restricted areas portions of the route, given a layer identifier and a source identifier. This method is invoked when the map view loads and any time routes are added.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                         routeRestrictedAreasLineLayerWithIdentifier identifier: String,
                                         sourceIdentifier: String) -> LineLayer?

    Parameters

    carPlayNavigationViewController
    identifier

    The LineLayer identifier.

    sourceIdentifier

    Identifier of the source, which contains the route data that this method would style.

    Return Value

    A LineLayer that is applied as restricted areas on the route line.

  • Asks the receiver to adjust the default layer which will be added to the map view and return a Layer. This method is invoked when the map view loads and any time a layer will be added.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController,
                                         willAdd layer: Layer) -> Layer?

    Parameters

    carPlayNavigationViewController
    layer

    A default Layer generated by the carPlayNavigationViewController.

    Return Value

    A Layer after adjusted and will be added to the map view by MapboxNavigation.