title: How to dismiss ViewController in Swift?
body: <p>I am trying to dismiss a ViewController in swift by calling <code>dismissViewController</code> in an <code>IBAction</code></p>
  
  <pre><code>  @IBAction func cancel(sender: AnyObject) {
      self.dismissViewControllerAnimated(false, completion: nil)
      println("cancel")
  }
  
  @IBAction func done(sender: AnyObject) {
      self.dismissViewControllerAnimated(false, completion: nil)
      println("done")
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/zH1KJ.png" alt="random image of a segue"></p>
  
  <p>I could see the println message in console output but ViewController never gets dismissed. What could be the problem? </p>