title: How do we create and dismiss an UIAlertController without user input? (Swift)
body: <p>I've been looking up a lot of tutorials on UIAlertController. Thus far, the way I found was to activate a UIAlertController by linking it to a button or label and then call a IBAction.</p>
  
  <p>I tried to replicate the code to automatically pop an alert when user enters the app (I wanted to ask the user if they want to go through the tutorial). However, I keep getting the error: </p>
  
  <blockquote>
    <p>Warning: Attempt to present UIAlertController on MainViewController whose view is not in the window hierarchy!</p>
  </blockquote>
  
  <p>Then I tried to add the UIAlertController to the MainViewController via addChildViewController and addSubview. However, I get the error:</p>
  
  <blockquote>
    <p>Application tried to present modally an active controller </p>
  </blockquote>
  
  <p>I figured that I cannot use the presentViewController function and commented it out.</p>
  
  <p>The UIAlertController is displayed BUT when I tried to click on the cancel or the never button, this error occurs.</p>
  
  <blockquote>
    <p>Trying to dismiss UIAlertController  with unknown presenter.</p>
  </blockquote>
  
  <p>I am really stumped. Can someone share what I am doing wrong? Thank you so much. Here is the code.</p>
  
  <pre><code>    func displayTutorial() {
  
      alertController = UIAlertController(title: NSLocalizedString("tutorialAlert", comment: ""), message: NSLocalizedString("tutorialMsg", comment: ""), preferredStyle: .ActionSheet)
  
      self.addChildViewController(alertController)
      self.view.addSubview(alertController.view)
      alertController.didMoveToParentViewController(self)
      alertController.view.frame.origin.x = self.view.frame.midX
      alertController.view.frame.origin.y = self.view.frame.midY
     //alertController.popoverPresentationController?.sourceView = self.view*/
  
  
      let OkAction = UIAlertAction(title: NSLocalizedString("yesh", comment: ""), style: .Destructive) { (action) in
  
      }
      alertController.addAction(OkAction)
  
      let cancelAction = UIAlertAction(title: NSLocalizedString("notNow", comment: ""), style: .Destructive) { (action) in
          //println(action)
          self.tutorial = 1
          self.presentedViewController?.dismissViewControllerAnimated(true, completion: nil)
      }
  
      alertController.addAction(cancelAction)
  
      let neverAction = UIAlertAction(title: NSLocalizedString("never", comment: ""), style: .Cancel) { (action) in
          self.tutorial = 1
      }
      alertController.addAction(neverAction)
  
  
      //self.presentViewController(alertController, animated: false) {}
  
  }
  </code></pre>