mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-01-16 22:16:41 +01:00
22 lines
852 B
Swift
Executable File
22 lines
852 B
Swift
Executable File
import UIKit
|
|
import SwiftUI
|
|
|
|
final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|
var window: UIWindow?
|
|
|
|
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
|
let window = UIWindow(frame: UIScreen.main.bounds)
|
|
window.rootViewController = UIHostingController(
|
|
rootView: SearchUserView().environmentObject(SearchUserViewModel())
|
|
)
|
|
self.window = window
|
|
window.makeKeyAndVisible()
|
|
if let windowScene = scene as? UIWindowScene {
|
|
let window = UIWindow(windowScene: windowScene)
|
|
window.rootViewController = UIHostingController(rootView: SearchUserView().environmentObject(SearchUserViewModel()))
|
|
self.window = window
|
|
window.makeKeyAndVisible()
|
|
}
|
|
}
|
|
}
|