title: Why window is nil in AppDelegate
body: <p>I need to present view controller from the <code>AppDelegate</code>, so I wrote the following code:</p>
  
  <pre><code>let storyboard = UIStoryboard(name: "Main", bundle: nil)
  let authViewController = storyboard.instantiateViewControllerWithIdentifier("ViewController") as ViewController
  if let keyWindow = UIApplication.sharedApplication().keyWindow {
      keyWindow.rootViewController = authViewController
  }
  </code></pre>
  
  <p>Unfortunately, <code>window</code> and <code>keyWindow</code> are both <code>nil</code>. Why?</p>