I'm trying to pop to a viewcontroller which I believe is at index 0. My ViewController name is HomeVC.
self.navigationController!.popToViewController(self.navigationController!.viewControllers[0] as! UIViewController, animated: true)
However, the code above only pops me back to the most recent viewcontroller. Not sure why it's not going to my HomeVC viewcontroller. Is their a way I can use the ViewController Name to pop to it?