方式1
直接返回到根视图
self.navigationController?.popToRootViewController(animated: true)
方式2
返回到上一个视图
self.navigationController?.popViewController(animated: true)
方式3
返回指定视图
for vc in (self.navigationController?.viewControllers)!
{
if vc is ViewController
{
self.navigationController?.popToViewController(vc, animated: true)
}
}
网友评论