title: navigationController popToViewController not working in swift 3
body: <p>I want use <code>popToViewController</code> of <code>navigationController</code> in swift 3.0.
  <br/>For that I written below code but nothing working as expected.</p>
  
  <pre><code>let controllers = self.navigationController?.viewControllers
  for vc in controllers! {
      if vc is HomeViewController {
          self.navigationController?.popToViewController(vc, animated: true)
      }
  }
  </code></pre>
  
  <p>I also wrote below code, but that is also working.</p>
  
  <pre><code>for vc in controllers! {
      if vc.isKind(of:HomeViewController.self) {
          self.navigationController?.popToViewController(vc, animated: true)
      }
  }
  </code></pre>
  
  <p>Please help me to solve this problem.</p>