CarPlayNavigationViewControllerDelegate
public protocol CarPlayNavigationViewControllerDelegate : AnyObject, UnimplementedLogging
The CarPlayNavigationViewControllerDelegate protocol provides methods for reacting to significant events during turn-by-turn navigation with CarPlayNavigationViewController.
-
carPlayNavigationViewControllerWillDismiss(_:byCanceling:)Default implementationCalled when the CarPlay navigation view controller is about to be dismissed, such as when the user ends a trip.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewControllerWillDismiss(_ carPlayNavigationViewController: CarPlayNavigationViewController, byCanceling canceled: Bool)Parameters
carPlayNavigationViewControllerThe CarPlay navigation view controller that was dismissed.
canceledTrue 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.
-
carPlayNavigationViewControllerDidDismiss(_:byCanceling:)Default implementationCalled when the CarPlay navigation view controller is dismissed, such as when the user ends a trip.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewControllerDidDismiss(_ carPlayNavigationViewController: CarPlayNavigationViewController, byCanceling canceled: Bool)Parameters
carPlayNavigationViewControllerThe CarPlay navigation view controller that was dismissed.
canceledTrue 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.
-
carPlayNavigationViewController(_:shouldPresentArrivalUIFor:)Default implementationCalled when the CarPlay navigation view controller detects an arrival.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController, shouldPresentArrivalUIFor waypoint: Waypoint) -> BoolParameters
carPlayNavigationViewControllerThe CarPlay navigation view controller that has arrived at a waypoint.
waypointThe waypoint that the user has arrived at.
Return Value
A boolean value indicating whether to show an arrival UI.
-
carPlayNavigationViewController(_:didAdd:pointAnnotationManager:)Default implementationTells the receiver that the final destination
PointAnnotationwas added to theCarPlayNavigationViewController.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController, didAdd finalDestinationAnnotation: PointAnnotation, pointAnnotationManager: PointAnnotationManager)Parameters
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.finalDestinationAnnotationThe point annotation that was added to the map view.
pointAnnotationManagerThe object that manages the point annotation in the map view.
-
carPlayNavigationViewController(_:routeLineLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
LineLayerfor 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
UnimplementedLoggingprints 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
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
Return Value
A
LineLayerthat is applied to the route line. -
carPlayNavigationViewController(_:waypointSymbolLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
SymbolLayerfor waypoint symbols, given an identifier and source. This method is invoked any time waypoints are added or shown.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController, waypointSymbolLayerWithIdentifier identifier: String, sourceIdentifier: String) -> SymbolLayer?Parameters
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.identifierThe
SymbolLayeridentifier.sourceIdentifierIdentifier of the source, which contains the waypoint data that this method would style.
Return Value
A
SymbolLayerthat the map applies to all waypoint symbols. -
carPlayNavigationViewController(_:waypointCircleLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
CircleLayerfor waypoints, given an identifier and source. This method is invoked any time waypoints are added or shown.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController, waypointCircleLayerWithIdentifier identifier: String, sourceIdentifier: String) -> CircleLayer?Parameters
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.identifierThe
CircleLayeridentifier.sourceIdentifierIdentifier of the source, which contains the waypoint data that this method would style.
Return Value
A
CircleLayerthat the map applies to all waypoints. -
carPlayNavigationViewController(_:routeCasingLineLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
LineLayerfor 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
UnimplementedLoggingprints 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
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
Return Value
A
LineLayerthat is applied as a casing around the route line. -
carPlayNavigationViewController(_:routeRestrictedAreasLineLayerWithIdentifier:sourceIdentifier:)Default implementationAsks the receiver to return a
LineLayerfor 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
UnimplementedLoggingprints 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
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
Return Value
A
LineLayerthat is applied as restricted areas on the route line. -
carPlayNavigationViewController(_:willAdd:)Default implementationAsks 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
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController, willAdd layer: Layer) -> Layer?Parameters
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.layerA default
Layergenerated by the carPlayNavigationViewController.Return Value
A
Layerafter adjusted and will be added to the map view byMapboxNavigation. -
carPlayNavigationViewController(_:guidanceBackgroundColorFor:)Default implementationAsks the receiver to adjust the default color of the main instruction background color for a specific user interface style. According to
CPMapTemplate.guidanceBackgroundColorNavigation SDK can’t guarantee that a custom color returned in this function will be actually applied, it’s up to CarPlay.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayNavigationViewController(_ carPlayNavigationViewController: CarPlayNavigationViewController, guidanceBackgroundColorFor style: UIUserInterfaceStyle) -> UIColor?Parameters
carPlayNavigationViewControllerThe
CarPlayNavigationViewControllerobject.styleA default
UIUserInterfaceStylegenerated by the system.Return Value
A
UIColorwhich will be used to updateCPMapTemplate.guidanceBackgroundColor
Install in Dash
CarPlayNavigationViewControllerDelegate Protocol Reference