title: Set rootViewController programmatically not working, picking initial view controller from storyboard only in Xcode 11
body: <p>Trying to change the root view controller programmatically, initially in storyboard as initial view controller is checked. Every time same viewController is opened which is set up as initialViewController in storyboard. Please guide. Sharing below what code tried so far:</p>
  
  <pre><code>let isLoggedIn = UserDefaults.standard.bool(forKey: kIsLoggedIn)
          if isLoggedIn{
              //Welcome Screen for Touch ID
              let storyboard = UIStoryboard(name: "Main", bundle: nil)
             // let rootVC = storyboard.instantiateViewController(withIdentifier: "WelcomeViewController") as! WelcomeViewController
              let rootVC = storyboard.instantiateViewController(withIdentifier: "DashboardVC") as! DashboardVC
              setRoot(rootVC: rootVC)
          }
          else{
              //Login Screen
              let storyboard = UIStoryboard(name: "Main", bundle: nil)
              let rootVC = storyboard.instantiateViewController(withIdentifier: "RegisterViewController") as! RegisterViewController
              setRoot(rootVC: rootVC)
          }
  
  func setRoot(rootVC: UIViewController){
      let navController = UINavigationController.init(rootViewController: rootVC)
      navController.isNavigationBarHidden = true
      //if let window = self.window{
          window?.rootViewController = rootVC
          window?.makeKeyAndVisible()
      //}
  }
  </code></pre>
  
  <p>Secondly, trying to change the rootViewController and trying to add MFSideMenu after login but not working swift. Please find it's code below:</p>
  
  <pre><code> func loadDashBoard(storyboard : UIStoryboard){
      let vc = storyboard.instantiateViewController(withIdentifier: "MenuNavigationController")
      let sideMenuVC = storyboard.instantiateViewController(withIdentifier: "SideMenuViewController") as! SideMenuViewController
      let container : MFSideMenuContainerViewController = MFSideMenuContainerViewController.container(withCenter: vc, leftMenuViewController: sideMenuVC, rightMenuViewController: nil)
      let navController = UINavigationController.init(rootViewController: container)
      navController.isNavigationBarHidden = true
  
          window?.rootViewController = navController
          window?.makeKeyAndVisible()
      }
  </code></pre>
  
  <p>All the above written code in AppDelegate.</p>