title: Navigation rootViewController issue with HomeVC Sign out Button in Swift
body: <p>I have home view controller with ENSideMenu for side menu and in home view controller i have sign out button. I have given ENSideMenu MyNavigationController as an is initial view controller in storyboard.</p>
  
  <p>I want to show home first in app which is working fine but when i come from login to home then home is not responding.. once i sign out then again home is responding. </p>
  
  <p>Here is my code:</p>
  
  <p>in appdelegate:</p>
  
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
      // Override point for customization after application launch.
  
      let userId: String? = KeychainWrapper.standard.string(forKey: "Uid") 
      print("appdelegate userid \(userId)")
      if userId != nil{
          let mainStoryBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
          let homeVC = mainStoryBoard.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController
          self.window!.rootViewController = homeVC
      }
      return true
  }
  </code></pre>
  
  <p>in loginButton in LogInVC:</p>
  
  <pre><code>    let saveUserId: Bool = KeychainWrapper.standard.set(Uid ?? "", forKey: "Uid")
                  print("the userid is \(saveUserId)")
  
                  if (Uid?.isEmpty)!
                  {
                      print("login fail")
                  }
                  else{
  
                      DispatchQueue.main.async {
  
                          let homeVC = self.storyboard?.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController
                          let appDelagate = UIApplication.shared.delegate
                          appDelagate?.window??.rootViewController = homeVC
                      }
                  }
  </code></pre>
  
  <p>in HomeVC:</p>
  
  <pre><code>  func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  
      let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "MakePaymentViewController") as! MakePaymentViewController
      self.navigationController?.pushViewController(nextViewController, animated: true)
      let indexPathHome = indexPath.row
      print("home collectionItem indexpath \(indexPathHome)")
  
  }
  
  
   @IBAction func signOutButton(_ sender: Any) {
      print("signout tapped")
      KeychainWrapper.standard.remove(key: "Uid")
   }
  
    @IBAction func sideMenuButton(_ sender: Any) {
      print("in side menu")
      toggleSideMenuView()
   }
  </code></pre>
  
  <p>I have given ENSideMenu MyNavigationController as an is initial view controller in storyboard.</p>
  
  <p>I need homeVc to respond after coming from login.
  please help me to solve the issue.</p>