CarPlayManagerDelegate
public protocol CarPlayManagerDelegate : AnyObject, UnimplementedLogging, CarPlayManagerDelegateDeprecations
CarPlayManagerDelegate is the main integration point for Mapbox CarPlay support.
Implement this protocol and assign an instance to the delegate property of the shared instance of CarPlayManager.
If no delegate is set, a default built-in MapboxNavigationService will be created and used when a trip begins.
-
carPlayManager(_:leadingNavigationBarButtonsCompatibleWith:in:for:)Default implementationOffers the delegate an opportunity to provide a customized list of leading bar buttons at the root of the template stack for the given activity.
These buttons’ tap handlers encapsulate the action to be taken, so it is up to the developer to ensure the hierarchy of templates is adequately navigable.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, leadingNavigationBarButtonsCompatibleWith traitCollection: UITraitCollection, in carPlayTemplate: CPTemplate, for activity: CarPlayActivity) -> [CPBarButton]?Parameters
carPlayManagerThe CarPlay manager instance.
traitCollectionThe trait collection of the view controller being shown in the CarPlay window.
carPlayTemplateThe template into which the returned bar buttons will be inserted.
activityWhat the user is currently doing on the CarPlay screen. Use this parameter to distinguish between multiple templates of the same kind, such as multiple
CPMapTemplates.Return Value
An array of bar buttons to display on the leading side of the navigation bar while
templateis visible. -
carPlayManager(_:trailingNavigationBarButtonsCompatibleWith:in:for:)Default implementationOffers the delegate an opportunity to provide a customized list of trailing bar buttons at the root of the template stack for the given activity.
These buttons’ tap handlers encapsulate the action to be taken, so it is up to the developer to ensure the hierarchy of templates is adequately navigable.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, trailingNavigationBarButtonsCompatibleWith traitCollection: UITraitCollection, in carPlayTemplate: CPTemplate, for activity: CarPlayActivity) -> [CPBarButton]?Parameters
carPlayManagerThe CarPlay manager instance.
traitCollectionThe trait collection of the view controller being shown in the CarPlay window.
carPlayTemplateThe template into which the returned bar buttons will be inserted.
activityWhat the user is currently doing on the CarPlay screen. Use this parameter to distinguish between multiple templates of the same kind, such as multiple
CPMapTemplates.Return Value
An array of bar buttons to display on the trailing side of the navigation bar while
templateis visible. -
carPlayManager(_:mapButtonsCompatibleWith:in:for:)Default implementationOffers the delegate an opportunity to provide a customized list of buttons displayed on the map.
These buttons handle the gestures on the map view, so it is up to the developer to ensure the map template is interactive. If this method is not implemented, or if nil is returned, a default set of zoom and pan buttons declared in the
CarPlayMapViewControllerwill be provided.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, mapButtonsCompatibleWith traitCollection: UITraitCollection, in carPlayTemplate: CPTemplate, for activity: CarPlayActivity) -> [CPMapButton]?Parameters
carPlayManagerThe CarPlay manager instance.
traitCollectionThe trait collection of the view controller being shown in the CarPlay window.
carPlayTemplateThe template into which the returned map buttons will be inserted.
activityWhat the user is currently doing on the CarPlay screen. Use this parameter to distinguish between multiple templates of the same kind, such as multiple
CPMapTemplates.Return Value
An array of map buttons to display on the map while
templateis visible.
-
carPlayManager(_:willPreview:)Default implementationOffers the delegate the opportunity to customize a trip before it is presented to the user to preview.
To customize the destination’s title, which is displayed when a route is selected, set the
MKMapItem.nameproperty of theCPTrip.destinationproperty. To add a subtitle, create a newMKMapItemwhoseMKPlacemarkhas theStreetkey in its address dictionary.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, willPreview trip: CPTrip) -> CPTripParameters
carPlayManagerThe CarPlay manager instance.
tripThe trip that will be previewed.
Return Value
The actual trip to be previewed. This can be the same trip or a new/alternate trip if desired.
-
carPlayManager(_:willPreview:with:)Default implementationOffers the delegate the opportunity to customize a trip preview text configuration for a given trip.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, willPreview trip: CPTrip, with previewTextConfiguration: CPTripPreviewTextConfiguration) -> CPTripPreviewTextConfigurationParameters
carPlayManagerThe CarPlay manager instance.
tripThe trip that will be previewed.
previewTextConfigurationThe trip preview text configuration that will be presented alongside the trip.
Return Value
The actual preview text configuration to be presented alongside the trip.
-
carPlayManager(_:selectedPreviewFor:using:)Default implementationOffers the delegate the opportunity to react to selection of a trip. Certain trips may have alternate route(s).
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, selectedPreviewFor trip: CPTrip, using routeChoice: CPRouteChoice)Parameters
carPlayManagerThe CarPlay manager instance.
tripThe trip to begin navigating along.
routeChoiceThe possible route for the chosen trip.
-
carPlayManagerWillCancelPreview(_:configuration:)Default implementationCalled when CarPlay will cancel routes preview. This delegate method will be called before canceling the routes preview.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManagerWillCancelPreview( _ carPlayManager: CarPlayManager, configuration: inout CarPlayManagerCancelPreviewConfiguration )Parameters
carPlayManagerThe CarPlay manager instance.
configurationThe configuration of the cancel preview action.
-
carPlayManagerDidCancelPreview(_:)Default implementationCalled when CarPlay canceled routes preview. This delegate method will be called after canceled the routes preview.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManagerDidCancelPreview(_ carPlayManager: CarPlayManager)Parameters
carPlayManagerThe CarPlay manager instance.
-
carPlayManager(_:navigationServiceFor:routeIndex:routeOptions:desiredSimulationMode:)Default implementationAsks the delegate to provide a navigation service. In multi-screen applications this should be the same instance used to guide the user along the route on the phone.
Important
this method is superseeded by
carPlayManager(_:navigationServiceFor:desiredSimulationMode:), and it’s call result will be preferred over current method’s.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
@available(*, deprecated, renamed: "carPlayManager(_:navigationServiceFor:desiredSimulationMode:﹚") func carPlayManager(_ carPlayManager: CarPlayManager, navigationServiceFor routeResponse: RouteResponse, routeIndex: Int, routeOptions: RouteOptions, desiredSimulationMode: SimulationMode) -> NavigationService?Parameters
carPlayManagerThe CarPlay manager instance.
routeResponseThe
RouteResponsecontaining a route for which the returned route controller will manage location updates.routeIndexThe index of the route within the original
RouteResponseobject.routeOptionsthe options that were specified for the route request.
desiredSimulationModeThe desired simulation mode to use.
Return Value
A navigation service that manages location updates along
route. -
carPlayManager(_:navigationServiceFor:desiredSimulationMode:)Default implementationAsks the delegate to provide a navigation service. In multi-screen applications this should be the same instance used to guide the user along the route on the phone.
Important
Implementing this method will suppress
carPlayManager(_:navigationServiceFor:routeIndex:routeOptions:desiredSimulationMode:)being called, using current one as the source of truth for providing navigation service.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, navigationServiceFor indexedRouteResponse: IndexedRouteResponse, desiredSimulationMode: SimulationMode) -> NavigationService?Parameters
carPlayManagerThe CarPlay manager instance.
indexedRouteResponseThe
IndexedRouteResponsecontaining a route, index and options for which the returned route controller will manage location updates.desiredSimulationModeThe desired simulation mode to use.
Return Value
A navigation service that manages location updates along
route. -
carPlayManager(_:didFailToFetchRouteBetween:options:error:)Default implementationCalled when the CarPlay manager fails to fetch a route.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didFailToFetchRouteBetween waypoints: [Waypoint]?, options: RouteOptions, error: DirectionsError) -> CPNavigationAlert?Parameters
carPlayManagerThe CarPlay manager instance.
waypointsthe waypoints for which a route could not be retrieved.
optionsThe route options that were attached to the route request.
errorThe error returned from the directions API.
Return Value
Optionally, a
CPNavigationAlertto present to the user. If this method returns an alert, the CarPlay manager will transition back to the map template and display the alert. If it returnsnil, the CarPlay manager will do nothing. -
carPlayManager(_:didBeginNavigationWith:)Default implementationCalled when navigation begins so that the containing app can update accordingly.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didBeginNavigationWith service: NavigationService)Parameters
carPlayManagerThe CarPlay manager instance.
serviceThe navigation service that has begun managing location updates for a navigation session.
-
carPlayManagerWillEndNavigation(_:byCanceling:)Default implementationCalled when navigation is about to be finished so that the containing app can update accordingly. This delegate method will be called before dismissing
CarPlayNavigationViewController.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManagerWillEndNavigation(_ carPlayManager: CarPlayManager, byCanceling canceled: Bool)Parameters
carPlayManagerThe CarPlay manager instance.
canceledA Boolean value indicating whether this method is being called because the user intends to cancel the trip, as opposed to letting it run to completion.
-
carPlayManagerDidEndNavigation(_:)Default implementationCalled when navigation ends so that the containing app can update accordingly. This delegate method will be called after dismissing
CarPlayNavigationViewController.If you need to know whether the navigation ended because the user arrived or canceled it, use the
carPlayManagerDidEndNavigation(_:byCanceling:)method.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManagerDidEndNavigation(_ carPlayManager: CarPlayManager)Parameters
carPlayManagerThe CarPlay manager instance.
-
carPlayManagerDidEndNavigation(_:byCanceling:)Default implementationCalled when navigation ends so that the containing app can update accordingly. This delegate method will be called after dismissing
CarPlayNavigationViewController.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManagerDidEndNavigation(_ carPlayManager: CarPlayManager, byCanceling canceled: Bool)Parameters
carPlayManagerThe CarPlay manager instance.
canceledA Boolean value indicating whether this method is being called because the user canceled the trip, as opposed to letting it run to completion/being canceled by the system.
-
carPlayManager(_:shouldPresentArrivalUIFor:)Default implementationCalled when the CarPlayManager detects the user arrives at the destination waypoint for a route leg.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, shouldPresentArrivalUIFor waypoint: Waypoint) -> BoolParameters
carPlayManagerThe CarPlay manager instance 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.
-
carPlayManagerShouldDisableIdleTimer(_:)Default implementationCalled when the carplay manager will disable the idle timer.
Implementing this method will allow developers to change whether idle timer is disabled when CarPlay is connected and the vice-versa when disconnected.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManagerShouldDisableIdleTimer(_ carPlayManager: CarPlayManager) -> BoolParameters
carPlayManagerThe CarPlay manager instance.
Return Value
A Boolean value indicating whether to disable idle timer when carplay is connected and enable when disconnected.
-
carPlayManager(_:willPresent:)Default implementationCalled when the CarPlayManager creates a new CarPlayNavigationViewController upon start of a navigation session.
Implementing this method will allow developers to query or customize properties of the CarPlayNavigationViewController before it is presented. For example, a developer may wish to perform custom map styling on the presented NavigationMapView.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, willPresent navigationViewController: CarPlayNavigationViewController)Parameters
carPlayManagerThe CarPlay manager instance.
navigationViewControllerThe CarPlayNavigationViewController that will be presented on the CarPlay display.
-
carPlayManager(_:didPresent:)Default implementationCalled when the CarPlayManager presents a new CarPlayNavigationViewController upon start of a navigation session.
Implementing this method will allow developers to query or customize properties of the presented CarPlayNavigationViewController. For example, a developer may wish to perform custom map styling on the presented NavigationMapView.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didPresent navigationViewController: CarPlayNavigationViewController)Parameters
carPlayManagerThe CarPlay manager instance.
navigationViewControllerThe CarPlayNavigationViewController that was presented on the CarPlay display.
-
carPlayManager(_:didAdd:to:pointAnnotationManager:)Default implementationTells the receiver that the
PointAnnotationrepresenting the final destination was added to eitherCarPlayMapViewControllerorCarPlayNavigationViewController.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didAdd finalDestinationAnnotation: PointAnnotation, to parentViewController: UIViewController, pointAnnotationManager: PointAnnotationManager)Parameters
carPlayManagerThe
CarPlayManagerobject.finalDestinationAnnotationThe point annotation that was added to the map view.
parentViewControllerThe view controller that contains the map view, which is an instance of either
CarPlayMapViewControllerorCarPlayNavigationViewController.pointAnnotationManagerThe object that manages the point annotation in the map view.
-
carPlayManager(_: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 carPlayManager(_ carPlayManager: CarPlayManager, waypointSymbolLayerWithIdentifier identifier: String, sourceIdentifier: String) -> SymbolLayer?Parameters
carPlayManagerThe
CarPlayManagerobject.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. -
carPlayManager(_: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 carPlayManager(_ carPlayManager: CarPlayManager, waypointCircleLayerWithIdentifier identifier: String, sourceIdentifier: String) -> CircleLayer?Parameters
carPlayManagerThe
CarPlayManagerobject.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.
-
carPlayManager(_:templateWillAppear:animated:)Default implementationCalled when a template presented by the
CarPlayManageris about to appear on the screen.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, templateWillAppear template: CPTemplate, animated: Bool)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template to show.
animatedA Boolean value indicating whether the system animates the presentation of the template.
-
carPlayManager(_:templateDidAppear:animated:)Default implementationCalled when a template presented by the
CarPlayManagerhas finished appearing on the screen.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, templateDidAppear template: CPTemplate, animated: Bool)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template shown onscreen.
animatedA Boolean value indicating whether the system animated the presentation of the template.
-
carPlayManager(_:templateWillDisappear:animated:)Default implementationCalled when a template presented by the
CarPlayManageris about to disappear from the screen.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, templateWillDisappear template: CPTemplate, animated: Bool)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template that will disappear from the screen.
animatedA Boolean value indicating whether the system animates the disappearance of the template.
-
carPlayManager(_:templateDidDisappear:animated:)Default implementationCalled when a template presented by the
CarPlayManagerhas finished disappearing from the screen.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, templateDidDisappear template: CPTemplate, animated: Bool)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template that disappeared from the screen.
animatedA Boolean value indicating whether the system animated the disappearance of the template.
-
carPlayManager(_:routeLineLayerWithIdentifier:sourceIdentifier:for:)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 carPlayManager(_ carPlayManager: CarPlayManager, routeLineLayerWithIdentifier identifier: String, sourceIdentifier: String, for parentViewController: UIViewController) -> LineLayer?Parameters
carPlayManagerThe
CarPlayManagerobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
parentViewControllerThe view controller that contains the map view, which is an instance of either
CarPlayMapViewControllerorCarPlayNavigationViewController.Return Value
A
LineLayerthat is applied to the route line. -
carPlayManager(_:routeCasingLineLayerWithIdentifier:sourceIdentifier:for:)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 carPlayManager(_ carPlayManager: CarPlayManager, routeCasingLineLayerWithIdentifier identifier: String, sourceIdentifier: String, for parentViewController: UIViewController) -> LineLayer?Parameters
carPlayManagerThe
CarPlayManagerobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
parentViewControllerThe view controller that contains the map view, which is an instance of either
CarPlayMapViewControllerorCarPlayNavigationViewController.Return Value
A
LineLayerthat is applied as a casing around the route line. -
carPlayManager(_:routeRestrictedAreasLineLayerWithIdentifier:sourceIdentifier:for:)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 carPlayManager(_ carPlayManager: CarPlayManager, routeRestrictedAreasLineLayerWithIdentifier identifier: String, sourceIdentifier: String, for parentViewController: UIViewController) -> LineLayer?Parameters
carPlayManagerThe
CarPlayManagerobject.identifierThe
LineLayeridentifier.sourceIdentifierIdentifier of the source, which contains the route data that this method would style.
parentViewControllerThe view controller that contains the map view, which is an instance of either
CarPlayMapViewControllerorCarPlayNavigationViewController.Return Value
A
LineLayerthat is applied as restricted areas on the route line. -
carPlayManager(_:willAdd:for:)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 are added.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, willAdd layer: Layer, for parentViewController: UIViewController) -> Layer?Parameters
carPlayManagerThe
CarPlayManagerobject.layerA default
Layergenerated by the carPlayManager.parentViewControllerThe view controller that contains the map view, which is an instance of either
CarPlayMapViewControllerorCarPlayNavigationViewController.Return Value
A
Layerafter adjusted and will be added to the map view byMapboxNavigation.
-
carPlayManager(_:didBeginPanGesture:)Default implementationCalled when the system detects a user starting to pan a map template visible on the screen.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didBeginPanGesture template: CPMapTemplate)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template on which the gesture was started.
-
carPlayManager(_:didEndPanGesture:)Default implementationCalled when the system detects a user stops panning a map template.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didEndPanGesture template: CPMapTemplate)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template on which the gesture was ended.
-
carPlayManager(_:didShowPanningInterface:)Default implementationCalled when the pan interface appears on the map template.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didShowPanningInterface template: CPMapTemplate)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template on which the panning interface is shown.
-
carPlayManager(_:willDismissPanningInterface:)Default implementationCalled when the panning interface will disappear on a map template.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, willDismissPanningInterface template: CPMapTemplate)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template on which the panning interface will be dismissed.
-
carPlayManager(_:didDismissPanningInterface:)Default implementationCalled when the panning interface disappeared on a map template.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, didDismissPanningInterface template: CPMapTemplate)Parameters
carPlayManagerThe
CarPlayManagerobject.templateThe template on which the panning interface was dismissed.
-
carPlayManager(_:shouldShowNotificationFor:in:)Default implementationDetermines if the maneuver should be presented as a notification when the app is in the background.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, shouldShowNotificationFor maneuver: CPManeuver, in mapTemplate: CPMapTemplate) -> BoolParameters
carPlayManagerThe
CarPlayManagerobject.maneuverManeuver, for which notification will be shown.
mapTemplateThe map template that is visible during either preview or navigation sessions.
Return Value
A boolean value indicating whether maneuver should appear as a notification.
-
Determines if the updated distance remaining for the maneuver should be presented as a notification when the app is in the background.
Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, shouldShowNotificationFor navigationAlert: CPNavigationAlert, in mapTemplate: CPMapTemplate) -> BoolParameters
carPlayManagerThe
CarPlayManagerobject.navigationAlertBanner alert, for which notification will be shown.
mapTemplateThe map template that is visible during either preview or navigation sessions.
Return Value
A boolean value indicating whether alert should appear as a notification.
-
carPlayManager(_:shouldUpdateNotificationFor:with:in:)Default implementationDetermines if the navigation alert should be presented as a notification when the app is in the background.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func carPlayManager(_ carPlayManager: CarPlayManager, shouldUpdateNotificationFor maneuver: CPManeuver, with travelEstimates: CPTravelEstimates, in mapTemplate: CPMapTemplate) -> BoolParameters
carPlayManagerThe
CarPlayManagerobject.maneuverManeuver, for which notification will be shown.
travelEstimatesObject that describes the time and distance remaining for the active navigation session.
mapTemplateThe map template that is visible during either preview or navigation sessions.
Return Value
A boolean value indicating whether updated estimates should appear in the notification.
-
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(_ carPlayManager: CarPlayManager, guidanceBackgroundColorFor style: UIUserInterfaceStyle) -> UIColor?Parameters
carPlayManagerThe
CarPlayManagerobject.styleA default
UIUserInterfaceStylegenerated by the system.Return Value
A
UIColorwhich will be used to updateCPMapTemplate.guidanceBackgroundColor
Install in Dash
CarPlayManagerDelegate Protocol Reference