Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2025 System ServicesApp Services

WWDC25 · 22 min · System Services / App Services

Turbocharge your app for CarPlay

Learn how to bring your Live Activities and widgets to CarPlay and CarPlay Ultra so people can view progress of their activities and see relevant information at a glance. Explore new template options available to all CarPlay apps, and learn how navigation apps can provide turn-by-turn metadata for display in the car’s instrument cluster or HUD.

Watch at developer.apple.com ↗

Transcript all transcripts

Chapters

Code shown on screen · 6 snippets

Set CarPlay as a disfavored location swift · at 3:21 ↗
// Disfavored locations modifier for CarPlay

WidgetConfiguration()
    .disfavoredLocations([.carPlay], for: [.systemSmall])
List template with pinned elements with grid buttons swift · at 10:05 ↗
// Pinned elements

var headerGridButtons: [CPGridButton]?

// Create a Grid Button

class CPGridButton

init(titleVariants: [String],
     image: UIImage,
     handler: ((CPGridButton) -> Void)?)
List template with pinned elements with grid buttons for messages swift · at 10:22 ↗
// Pinned elements

var headerGridButtons: [CPGridButton]?

// For Communication apps

class CPGridButton

init(titleVariants: [String],
     image: UIImage,
     messageConfiguration: CPMessageGridItemConfiguration?,
     handler: ((CPGridButton) -> Void)?)

class CPMessageGridItemConfiguration

init(conversationIdentifier: String, unread: Bool)
Now playing template with sports mode swift · at 11:20 ↗
// Now playing template with sports mode

let clock = CPNowPlayingSportsClock(elapsedTime: time, paused: false)

let status = CPNowPlayingSportsEventStatus(
    eventStatusText: ["1st"], // 1st quarter
    eventStatusImage: UIImage(named: "Semifinals"),
    eventClock: clock
)

let sports = CPNowPlayingModeSports(
    leftTeam: getLeftTeam(), // CPNowPlayingSportsTeam
    rightTeam: getRightTeam(), // CPNowPlayingSportsTeam
    eventStatus: status,
    backgroundArtwork: getBackgroundArtwork() // get UIImage
)

CPNowPlayingTemplate.sharedTemplate.nowPlayingMode = sports
Multitouch callbacks swift · at 14:15 ↗
// Multitouch

// Zoom callback

func mapTemplate(_ mapTemplate: CPMapTemplate,
                 didUpdateZoomGestureWithCenter center: CGPoint,
                 scale: CGFloat,
                 velocity: CGFloat) {     }

// Pitch callback

func mapTemplate(_ mapTemplate: CPMapTemplate,
                 pitchWithCenter center: CGPoint) {     }

// Rotate callback

func mapTemplate(_ mapTemplate: CPMapTemplate,
                 didRotateWithCenter center: CGPoint,
                 rotation: CGFloat,
                 velocity: CGFloat) {     }
Add support for metadata swift · at 16:28 ↗
// Add support for metadata

// Declare support

func mapTemplateShouldProvideNavigationMetadata(_ mapTemplate: CPMapTemplate) -> Bool {
    true
}

// Provide maneuver information up-front

cpNavigationSession.add(maneuvers)
cpNavigationSession.add(laneGuidance)

// Reroute

cpNavigationSession.pauseTrip(for: .rerouting, description: "Rerouting")
cpNavigationSession.resumeTrip(updatedRouteInformation: cpRouteInformation)

Resources