View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Videos

Abrir menú Cerrar menú
  • Colecciones
  • Todos los videos
  • Información

Más videos

  • Información
  • Código
  • Accelerate your app with CarPlay

    CarPlay is the smarter, safer way for people to use iPhone in the car. We'll show you how to build great apps for the car screen, and introduce you to developing CarPlay apps in categories like EV charging, parking, and quick food ordering. We'll also share how existing audio and communication apps can take advantage of improvements to the CarPlay framework to create a more flexible UI.

    Recursos

    • CarPlay for developers
    • Human Interface Guidelines: CarPlay
      • Video HD
      • Video SD

    Videos relacionados

    WWDC22

    • Get more mileage out of your app with CarPlay

    WWDC19

    • Introducing SiriKit Media Intents

    WWDC18

    • CarPlay Audio and Navigation Apps
  • Buscar este video…
    • 4:24 - CarPlay scene manifest

      // CarPlay Scene Manifest
      
      <key>UIApplicationSceneManifest</key>
      <dict>
          <key>UISceneConfigurations</key>
      	<dict>
      		<key>CPTemplateApplicationSceneSessionRoleApplication</key>
      		<array>
      			<dict>
      				<key>UISceneClassName</key>
      				<string>CPTemplateApplicationScene</string>
      				<key>UISceneConfigurationName</key>
      				<string>MyApp—Car</string>
      				<key>UISceneDelegateClassName</key>
      				<string>MyApp.CarPlaySceneDelegate</string>
      			</dict>
      		</array>
      	</dict>
      </dict>
    • 5:12 - CarPlay app lifecycle

      // CarPlay App Lifecycle
      
      import CarPlay
      
      class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate {
          var interfaceController: CPInterfaceController?
         
          func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,
                  didConnect interfaceController: CPInterfaceController) {
      
              self.interfaceController = interfaceController
              let item = CPListItem(text: "Rubber Soul", detailText: "The Beatles") 
              let section = CPListSection(items: [item]) 
              let listTemplate = CPListTemplate(title: "Albums", sections: [section])
              interfaceController.setRootTemplate(listTemplate, animated: true)
          }
      
        func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,
                  didDisconnect interfaceController: CPInterfaceController) {
          self.interfaceController = nil
      }
    • 5:54 - Create a CPListTemplate

      // CPListTemplate
      
      import CarPlay
      
      let item = CPListItem(text: "Rubber Soul", detailText: "The Beatles") 
      let section = CPListSection(items: [item]) 
      let listTemplate = CPListTemplate(title: "Albums", sections: [section]) 
      self.interfaceController.pushTemplate(listTemplate, animated: true)
    • 6:09 - Handle user selection in a list item

      // CPListTemplate
      
      import CarPlay
      
      let item = CPListItem(text: "Rubber Soul", detailText: "The Beatles") 
      item.listItemHandler = { item, completion, [weak self] in
          // Start playback, then...
          self?.interfaceController.pushTemplate(CPNowPlayingTemplate.shared, animated: true)
          completion()
      }
      
      // Later...
      item.image = ...
    • 7:58 - Create a CPTabBarTemplate

      // CPTabBarTemplate
      
      import CarPlay
      
      let item = CPListItem(text: "Rubber Soul", detailText: "The Beatles") 
      let section = CPListSection(items: [item]) 
      let favorites = CPListTemplate(title: "Albums", sections: [section])
      favorites.tabSystemItem = .favorites
      favorites.showsTabBadge = true
      
      let albums: CPGridTemplate = ...
      albums.tabTitle = "Albums"
      albums.tabImage = ...
      
      let tabBarTemplate = CPTabBarTemplate(templates: [favorites, albums])
      self.interfaceController.setRootTemplate(tabBarTemplate, animated: false)
      
      // Later...
      favorites.showsTabBadge = false
      tabBarTemplate.updateTemplates([favorites, albums])
    • 9:34 - Create a CPListImageRowItem

      // List Items for Audio Apps
      
      import CarPlay
      
      let gridImages: [UIImage] = ...
      let imageRowItem = CPListImageRowItem(text: "Recent Audiobooks", images: gridImages) 
      
      imageRowItem.listItemHandler = { item, completion in
          print("Selected image row header!")
          completion()
      }
      
      imageRowItem.listImageRowHandler = { item, index, completion in
          print("Selected artwork at index \(index)!")
          completion()
      }
      
      let section = CPListSection(items: [imageRowItem]) 
      let listTemplate = CPListTemplate(title: "Listen Now", sections: [section]) 
      self.interfaceController.pushTemplate(listTemplate, animated: true)
    • 12:50 - Configure the shared now playing template

      // Now Playing Template
      
      import CarPlay
      
      class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate {
      
          func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,
                  didConnect interfaceController: CPInterfaceController) {
            
              let nowPlayingTemplate = CPNowPlayingTemplate.shared
      
              let rateButton = CPNowPlayingPlaybackRateButton() { button in
                                                                 
                  // Change the playback rate!
                                                                 
              }
              nowPlayingTemplate.updateNowPlayingButtons([rateButton])
          }
      }
    • 19:46 - Handle Point of Interest Template map region changes

      // CPPointOfInterestTemplateDelegate
      
      func pointOfInterestTemplate(_ template: CPPointOfInterestTemplate, 
                                   didChangeMapRegion region: MKCoordinateRegion) {
      
          self.locationManager.locations(for: region) { locations in
              template.setPointsOfInterest(locations, selectedIndex: 0)
          }
      }
    • 20:23 - Create points of interest

      // CPPointOfInterest creation
      
      func locations(for region: MKCoordinateRegion, 
                     handler: ([CPPointOfInterest]) -> Void) {
          var tempateLocations: [CPPointOfInterest] = []
              
          for clientModel in self.executeQuery(for: region) {
              let templateModel : CPPointOfInterest = self.locations[clientModel.mapItem] ??
                      CPPointOfInterest(location: clientModel.mapItem,
                                        title: clientModel.title,
                                        subtitle: clientModel.subtitle,
                                        informativeText: clientModel.informativeText,
                                        image: clientModel.mapImage)
                  
                  
              tempateLocations.append(templateModel)
          }
          handler(templateLocations)
      }
    • 21:05 - Point of interest selection buttons

      // Point of Interest Template location selection
      
      let primaryButton = CPPointOfInterestButton(title: "Select") { button, [weak self] in
                  let selectedIndex = ...
                  
                  if selectedIndex != NSNotFound {
                      // Remove any existing selected state on previous location
                      self?.selectedLocation.image = defaultMapImage
                      // Change annotation for selected POI
                      self?.selectedLocation = templateModel
                      templateModel.image = selectedMapImage
                      // Update the template with new values
                      self?.pointOfInterestTemplate.selectedIndex = selectedIndex
                  }
              }
      
      let templateModel: CPPointOfInterest = ...
      
      templateModel.primaryButton = primaryButton

Developer Footer

  • Videos
  • WWDC20
  • Accelerate your app with CarPlay
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines