CPTemplateApplicationSceneDelegate
The methods for responding to the life cycle events of your app’s scene.
Declaration
@MainActor protocol CPTemplateApplicationSceneDelegate : UISceneDelegateMentioned in
Overview
This protocol defines methods that CarPlay calls when the scene connects and disconnects, as well as methods for responding to certain user actions. Use your implementation to provide the appropriate behavior for when these events occur. For example, creating and setting your root template when CarPlay launches your app and connects its scene.
You don’t create instances of your scene delegate directly. Instead, you specify the name of the class as part of the CarPlay scene configuration you add to your Info.plist file—see the example below—or that you return from your app delegate’s application(_:configurationForConnecting:options:) method.
<key>CPTemplateApplicationSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>CPTemplateApplicationScene</string>
<key>UISceneConfigurationName</key>
<string>MyCarPlaySceneConfiguration</string>
<!-- Specify the name of your scene delegate class. -->
<key>UISceneDelegateClassName</key>
<string>MyCarPlaySceneDelegate</string>
</dict>
</array>Topics
Responding to the Scene Life Cycle
templateApplicationScene(_:didConnect:)templateApplicationScene(_:didConnect:to:)templateApplicationScene(_:didDisconnectInterfaceController:)templateApplicationScene(_:didDisconnect:from:)