diff --git a/BiBaBoo-iOS/BiBaBoo-iOS/Application/SceneDelegate.swift b/BiBaBoo-iOS/BiBaBoo-iOS/Application/SceneDelegate.swift index 4856389..ec7ebef 100644 --- a/BiBaBoo-iOS/BiBaBoo-iOS/Application/SceneDelegate.swift +++ b/BiBaBoo-iOS/BiBaBoo-iOS/Application/SceneDelegate.swift @@ -13,12 +13,19 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let _ = (scene as? UIWindowScene) else { return } + + // 1. + guard let windowScene = (scene as? UIWindowScene) else { return } + // 2. + self.window = UIWindow(windowScene: windowScene) + // 3. + let navigationController = UINavigationController(rootViewController: ViewController()) + self.window?.rootViewController = navigationController + // 4. + self.window?.makeKeyAndVisible() } + func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded.