title: iOS: Go back to previous view
body: <p>I have two views like this in Story Board:</p>
  
  <p>[View1] -> [Navigation Controller] -> [View2]</p>
  
  <p>To go from View1(has tableview) to View 2, i do this on click of a row on View1:</p>
  
  <pre><code>self.performSegueWithIdentifier("showmyview2", sender:self)
  </code></pre>
  
  <p>This works.</p>
  
  <p>Now i have a button on View 2, which when clicked should take me back to previous view i.e View 1.</p>
  
  <p>I tried this:</p>
  
  <pre><code> navigationController!.popViewControllerAnimated(true)
  </code></pre>
  
  <p>But this does not work. How do i go back to first view?</p>