Files
VibeCoding/webrtc_controller_ios/web_rtc_controller_ios/App/SceneDelegate.swift

22 lines
735 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import UIKit
import SwiftUI
/// UIHostingController SwiftUI UIKit SwiftUI
final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
let window = UIWindow(windowScene: windowScene)
let hosting = UIHostingController(rootView: ContentView())
hosting.view.backgroundColor = .black
window.rootViewController = hosting
window.makeKeyAndVisible()
self.window = window
}
}