title: Memory consumption - Appdelegate's windows root viewcontroller
body: <p>I have reassigned the windows rootviewcontroller when logout the app. My question is if I do like this, all the navigationcontroller and its stack will be cleared out or it remains in memory. This is the code</p>
  
  <pre><code>if let delegate = UIApplication.shared.delegate as? AppDelegate, let window = delegate.window, let loginVC = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() {
  
              window.rootViewController = loginVC
              window.makeKeyAndVisible()
          }
  </code></pre>