显示第一个VC后我有导航控制器。我正在使用perform segue从第一个vc导航到第二页performSegue(withIdentifier: "secondVC", sender: nil)
并且我的侧边栏正在出现。但是,当我试图从第一个vc进入第三页时,它不会导航。所以,我尝试使用以下代码
let thirdVC = self.storyboard?.instantiateViewController(withIdentifier: "thirdVC") as! ThirdVC
navigationController?.pushViewController(thirdVC, animated: true)
它正常工作,但当我使用上面的代码时,我的导航栏正在消失。我怎么能从第一个vc到第三个?
答案 0 :(得分:1)
你可以试试这个
let thirdVC = self.storyboard?.instantiateViewController(withIdentifier: "thirdVC") as! ThirdVC
navigationController?.isNavigationBarHidden = false
//Make sure navigation controller should be there
navigationController?.pushViewController(thirdVC, animated: true)