title: How to init uiwindow with specific root controller in xcode 11 for new project?
body: <p>I want to initialize window inside <code>appDelegate</code> to show specific <code>ViewController</code> depend on some cases. Now I have this code: </p>
  
  <pre><code>class AppDelegate: UIResponder, UIApplicationDelegate {
  
      var window: UIWindow?
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
          // Override point for customization after application launch.
  
          window = UIWindow()
  
          let rootNavigationController = UIViewController()
          window?.rootViewController = rootNavigationController
          window?.rootViewController?.view.backgroundColor = .green
  
          window?.makeKeyAndVisible()
          return true
      }
  
      // MARK: UISceneSession Lifecycle
  
      func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -&gt; UISceneConfiguration {
          // Called when a new scene session is being created.
          // Use this method to select a configuration to create the new scene with.
          return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
      }
  
      func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set&lt;UISceneSession&gt;) {
          // Called when the user discards a scene session.
          // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
          // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
      }
  
  }
  </code></pre>
  
  <p>I'm using <code>XCode11</code> and have created new project. <code>SceneDelegate</code> file I removed cause it hasn't effect on this. Also removed Main from <code>Info.plist</code> and from deployment info</p>
  
  <p>As result on device I see black screen but debugger show me that rootNavigationController as should be
  <a href="https://i.stack.imgur.com/sxQ2W.png" rel="nofollow noreferrer">image from debugger</a></p>
  
  <p>How fix it or implement this logic for <code>XCode11</code>? </p>