title: Back button to root navigation controller
body: <p>I'm using storyboard and have 3 VCs. When I'm on VC3 I would like the back button to skip VC2 and go to VC1.</p>
  
  <p>I tried the following which works but VC2 flashes before I get to VC1</p>
  
  <pre><code>override func viewWillDisappear(_ animated: Bool) {
      self.navigationController?.popViewController(animated: true)
  }
  </code></pre>
  
  <p>My custom back code:</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
      self.navigationController?.navigationBar.shadowImage = UIImage()
      self.navigationController?.navigationBar.isTranslucent = true
      self.navigationController?.navigationBar.backIndicatorImage = UIImage(named: "arrow_back")
      self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = UIImage(named: "arrow_back")
      self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: #selector(self.backPressed(_:)))
      self.navigationController?.navigationBar.barStyle = .black  
  }
  
  @objc func backPressed(_ sender: Any){
      print("here")
      self.navigationController?.popToRootViewController(animated: false)
  }
  </code></pre>