UINavigationController 返回任意目录

UINavigationController 返回任意目录

返回上一级
[self.navigationController popViewControllerAnimated:YES];

返回第一级
popToRootViewControllerAnimated:YES

返回到中间任意一级

[self.navigationController popToViewController: [self.navigationController.viewControllers objectAtIndex: ([self.navigationController.viewControllers count] -2)] animated:YES];  

原文地址:https://www.cnblogs.com/rollrock/p/3013899.html