title: How do I create a cancel button?
body: <p>I am having troubles getting my cancel button to work. I have this action connected to my cancel button and I plan to dismiss the view controller like so:</p>
  
  <pre><code>@IBAction func cancel(sender: UIBarButtonItem) {
       dismissViewControllerAnimated(true, completion: nil)
  }
  </code></pre>
  
  <p>I was wondering what obvious bit I am missing. (This is a bar button item for a table view).</p>