title: iOS how to simple return back to previous presented/pushed view controller programmatically?
body: <p>How to return back to previous view controller programmatically? I found this <a href="https://stackoverflow.com/questions/28760541/programmatically-go-back-to-previous-viewcontroller-in-swift">answer</a>, but there is an example that demonstrate how to go back if we have navigation stack:</p>
  
  <pre><code>navigationController?.popViewControllerAnimated(true)
  </code></pre>
  
  <p>It's ok in case my queue of controllers based on navigation controller. But usually we use storyboard where we specify segue that marked with keyword <em>Show</em> that means we don't care about navigation push or present new view controllers. So in this case I presume there is only option with unwind view controller via segue, but maybe there is some simple call that I can do programmatically to go back to my previous view controller without checking if my stack of view controllers contain <code>UINavigationController</code> or not.</p>
  
  <p>I am looking for something simple like <code>self.performSegueToReturnBack</code>.</p>