feat: base setup for carplay
This commit is contained in:
24
ios/Fintunes/PhoneSceneDelegate.swift
Normal file
24
ios/Fintunes/PhoneSceneDelegate.swift
Normal 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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user