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 ↗Chapters
Code shown on screen · 6 snippets
Set CarPlay as a disfavored location
// Disfavored locations modifier for CarPlay
WidgetConfiguration()
.disfavoredLocations([.carPlay], for: [.systemSmall]) List template with pinned elements with grid buttons
// 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
// 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
// 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
// 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
// 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
Related sessions
-
24 min -
21 min -
19 min -
28 min -
33 min