title: Opening a navigation controller from Tabbar with back button on first ViewController
body: <p>I know this question has been asked so many times on the SO, but I am asking this just because it is relevantly different and also some answers are out dated and some are in Objective-c which I can not understand properly.</p>
  
  <p><strong>USE CASE:</strong></p>
  
  <p>I have a UITabBar controller, and it is working fine. Let say I have 4 tabs in it and user click on the button given in the Tab 4. now on it I have to open some series of View Controllers. let say User has following patteren to follow. </p>
  
  <p>4.A-->4.B--> 4.C  and can go back to first like so:  4.C-->4.B-->4.A</p>
  
  <p>And finally User must also be allowed to go back to Tab4 after closing 4.A view controller </p>
  
  <p><strong>WHAT I DID:</strong>
  I am able to open the View controller using this code. </p>
  
  <pre><code>let VC1 = storyboard.instantiateViewController(withIdentifier :"myVcId") as! UIViewController
      let navController = UINavigationController(rootViewController: VC1) // Creating a navigation controller with VC1 at the root of the navigation stack.
      self.present(navController, animated:true, completion: nil)
  </code></pre>
  
  <p>This is opening a navigation controller and having me navigate the view controller as per my requirements but I want following thing too </p>
  
  <p><strong>WHAT I WANT:</strong> As I am presenting the Navigation Controller modally, I want to show the back button at very first view controller, and I want that if user select back button it kills all the Navigation controller and go the previous view controller where he came from </p>