CarPlayNavigationViewController

@available(iOS 12.0, *)
public class CarPlayNavigationViewController : UIViewController
extension CarPlayNavigationViewController: StyleManagerDelegate
extension CarPlayNavigationViewController: NavigationServiceDelegate
extension CarPlayNavigationViewController: NavigationMapViewDelegate

CarPlayNavigationViewController is a fully-featured turn-by-turn navigation UI for CarPlay.

  • Creates a new CarPlay navigation view controller for the given route controller and user interface.

    Postcondition

    Call startNavigationSession(for:) after initializing this object to begin navigation.

    Declaration

    Swift

    required public init(navigationService: NavigationService,
                         mapTemplate: CPMapTemplate,
                         interfaceController: CPInterfaceController,
                         manager: CarPlayManager,
                         styles: [Style]? = nil)

    Parameters

    navigationService

    The navigation service managing location updates for the navigation session.

    mapTemplate

    The map template visible during the navigation session.

    interfaceController

    The interface controller for CarPlay.

    manager

    The manager for CarPlay.

    styles

    The interface styles that the view controller’s internal StyleManager object can select from for display.

  • Begins a navigation session along the given trip.

    Declaration

    Swift

    public func startNavigationSession(for trip: CPTrip)

    Parameters

    trip

    The trip to begin navigating along.

  • Ends the current navigation session.

    Declaration

    Swift

    public func exitNavigation(byCanceling canceled: Bool = false)

    Parameters

    canceled

    A 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.

  • Shows the interface for providing feedback about the route.

    Declaration

    Swift

    public func showFeedback()