CarPlayManager

@available(iOS 12.0, *)
public class CarPlayManager : NSObject
extension CarPlayManager: CPApplicationDelegate
extension CarPlayManager: CPInterfaceControllerDelegate
extension CarPlayManager: CPMapTemplateDelegate
extension CarPlayManager: CarPlayNavigationViewControllerDelegate
extension CarPlayManager: CarPlayMapViewControllerDelegate

CarPlayManager is the main object responsible for orchestrating interactions with a Mapbox map on CarPlay.

Messages declared in the CPApplicationDelegate protocol should be sent to this object in the containing application’s application delegate. Implement CarPlayManagerDelegate in the containing application and assign an instance to the delegate property of your CarPlayManager instance.

Note

It is very important you have a single CarPlayManager instance at any given time. This should be managed by your UIApplicationDelegate class if you choose to supply your accessToken to the CarPlayManager.eventsManager via NavigationEventsManager initializer, instead of the Info.plist.
  • A controller that manages the templates for constructing a scene’s user interface.

    Declaration

    Swift

    public fileprivate(set) var interfaceController: CPInterfaceController? { get }
  • Main window for content, presented on the CarPlay screen.

    Declaration

    Swift

    public fileprivate(set) var carWindow: UIWindow? { get }
  • A template that displays a navigation overlay on the map.

    Declaration

    Swift

    public fileprivate(set) var mainMapTemplate: CPMapTemplate? { get }
  • A Boolean value indicating whether the phone is connected to CarPlay.

    Declaration

    Swift

    public static var isConnected: Bool
  • The bar button that exits the navigation session.

    Declaration

    Swift

    public lazy var exitButton: CPBarButton { get set }
  • The bar button that mutes the voice turn-by-turn instruction announcements during navigation.

    Declaration

    Swift

    public lazy var muteButton: CPBarButton { get set }
  • The bar button that prompts the presented navigation view controller to display the feedback screen.

    Declaration

    Swift

    public lazy var showFeedbackButton: CPMapButton { get set }
  • The bar button that shows the selected route overview on the map.

    Declaration

    Swift

    public lazy var userTrackingButton: CPMapButton { get set }