title: AlertController is not in the window hierarchy
body: <p>I've just created a Single View Application project with ViewController class. I would like to show a UIAlertController from a function which is located inside my own class. </p>
  
  <p>Here is my class with an alert.</p>
  
  <pre><code>class AlertController: UIViewController {
       func showAlert() { 
           var alert = UIAlertController(title: "abc", message: "def", preferredStyle: .Alert)
           self.presentViewController(alert, animated: true, completion: nil)
       }
  }
  </code></pre>
  
  <p>Here is ViewController which executes the alert.</p>
  
  <pre><code>class ViewController: UIViewController {
     override func viewDidLoad() {
         super.viewDidLoad()  
     }
  
     @IBAction func showAlertButton(sender: AnyObject) {
         var alert = AlertController()
         alert.showAlert()
     }
  }
  </code></pre>
  
  <p>This is what I get instead of a beautiful alert.</p>
  
  <p><strong><em>Warning: Attempt to present UIAlertController: 0x797d2d20 on Sprint1.AlertController: 0x797cc500 whose view is not in the window hierarchy!</em></strong></p>
  
  <p>What should I do?</p>