feat: base setup for carplay

This commit is contained in:
Lei Nelissen
2025-05-24 17:41:28 +02:00
parent eb45169060
commit da9653cfe8
12 changed files with 207 additions and 59 deletions

View File

@@ -0,0 +1,24 @@
import UIKit
import React
class PhoneSceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(
_ scene: UIScene, willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
guard let windowScene = scene as? UIWindowScene else { return }
guard let appRootView = appDelegate.window?.rootViewController?.view else { return }
let containerViewController = UIViewController()
containerViewController.view.addSubview(appRootView)
appRootView.frame = containerViewController.view.bounds
let window = UIWindow(windowScene: windowScene)
window.rootViewController = containerViewController
self.window = window
window.makeKeyAndVisible()
}
}