@@ -3,17 +3,35 @@ import ComposeApp
33
44@main
55class AppDelegate : UIResponder , UIApplicationDelegate {
6- var window : UIWindow ?
76
87 func application(
98 _ application: UIApplication ,
109 didFinishLaunchingWithOptions launchOptions: [ UIApplication . LaunchOptionsKey : Any ] ?
1110 ) -> Bool {
12- window = UIWindow ( frame: UIScreen . main. bounds)
13- if let window = window {
14- window. rootViewController = MainKt . MainViewController ( )
15- window. makeKeyAndVisible ( )
16- }
11+ // Additional initialization if needed
1712 return true
1813 }
14+
15+ // Provide a scene configuration for connecting scenes (iOS 13+)
16+ func application( _ application: UIApplication ,
17+ configurationForConnecting connectingSceneSession: UISceneSession ,
18+ options: UIScene . ConnectionOptions ) -> UISceneConfiguration {
19+ let config = UISceneConfiguration ( name: " Default Configuration " , sessionRole: connectingSceneSession. role)
20+ config. delegateClass = SceneDelegate . self
21+ config. sceneClass = UIWindowScene . self
22+ return config
23+ }
24+ }
25+
26+ // MARK: - UIScene support
27+ class SceneDelegate : UIResponder , UIWindowSceneDelegate {
28+ var window : UIWindow ?
29+
30+ func scene( _ scene: UIScene , willConnectTo session: UISceneSession , options connectionOptions: UIScene . ConnectionOptions ) {
31+ guard let windowScene = scene as? UIWindowScene else { return }
32+ let window = UIWindow ( windowScene: windowScene)
33+ window. rootViewController = MainKt . MainViewController ( )
34+ window. makeKeyAndVisible ( )
35+ self . window = window
36+ }
1937}
0 commit comments