Last active
October 8, 2020 17:20
-
-
Save schmittsfn/6c6a65d9253b14487deaa6f16e206b45 to your computer and use it in GitHub Desktop.
CarPlaySceneDelegate of CarPlay Parking App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import CarPlay | |
| import Foundation | |
| @available(iOS 14.0, *) | |
| final class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate { | |
| var interfaceController: CPInterfaceController? | |
| var coordinator: CarPlayBaseCoordinator? | |
| // CarPlay connected | |
| func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) { | |
| self.interfaceController = interfaceController | |
| coordinator = CarPlayBaseCoordinator(interfaceController: interfaceController) | |
| coordinator?.start() | |
| } | |
| // CarPlay disconnected | |
| func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnect interfaceController: CPInterfaceController, from window: CPWindow) { | |
| self.coordinator = nil | |
| self.interfaceController = nil | |
| } | |
| } |
Author
schmittsfn
commented
Oct 8, 2020

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment