title: iOS 13: Swift - 'Set application root view controller programmatically' does not work
body: <p>I have following code in my AppDelegate.swift to setup root view controller for an iOS application. But it does not work. It follows Target structure (defined under General tab) and ignores this code.</p>
  
  <p>(Xcode 11, Swift 5.1, iOS 13)</p>
  
  <pre><code>class AppDelegate: UIResponder, UIApplicationDelegate {
  
      var window: UIWindow?
  
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
  
          window = UIWindow(frame: UIScreen.main.bounds)
          guard let rootVC = UIViewController() else {
              print("Root VC not found")
              return true
          }
          let rootNC = UINavigationController(rootViewController: rootVC)
          window?.rootViewController = rootNC
          window?.makeKeyAndVisible()
  
          return true
      }
  }
  </code></pre>
  
  <p>Unable to understand where is the issue. </p>
  
  <p>I tried following references also but no luck:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/33374272/swift-ios-set-a-new-root-view-controller">Swift ios set a new root view controller</a></li>
  <li><a href="https://stackoverflow.com/questions/31062108/root-view-controller-swift">Root View Controller Swift</a></li>
  <li><a href="https://medium.com/@stasost/ios-root-controller-navigation-3625eedbbff" rel="noreferrer">iOS: Root Controller Navigation</a></li>
  </ul>