title: Can't dismiss UIAlertController
body: <p>I have a UIAlertController that pops up if there is no internet connection. I don't know how to properly dismiss it when the connection is back. As I keep checking for it every 10 sec, if I do :</p>
  
  <pre><code>self.dismissViewControllerAnimated(true, completion: nil)
  </code></pre>
  
  <p>this will dismiss the main view at every interval once the alert view was already dismissed. I tried:</p>
  
  <pre><code>  let alert = UIAlertController(title: "No internet Connection", message: "Make sure your device is connected to the internet.", preferredStyle: UIAlertControllerStyle.Alert)
  
      if Reachability.isConnectedToNetwork() == true {
          print("Internet connection OK")
  
          alert.dismissViewControllerAnimated(true, completion: nil)
  
      } else {
          print("Internet connection FAILED")
  
          self.presentViewController(alert, animated: true, completion: nil)
      }
  </code></pre>
  
  <p>but <code>alert.dismissViewControllerAnimated(true, completion: nil)</code> doesn't work.
  Thanks!</p>