本文主要是介绍popToViewController的用法已经关闭所ViewController的方法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
popToViewController的用法[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2]
animated:YES];
还有一种:
for (UIViewController *temp in self.navigationController.viewControllers) {if ([temp isKindOfClass:[你要跳转到的Controller class]]) {[self.navigationController popToViewController:temp animated:YES];}}
关闭所有
//关闭所有的ViewController
-(void)dismissModalStack {UIViewController *vc = self.presentingViewController;while (vc.presentingViewController) {vc = vc.presentingViewController;}[vc dismissViewControllerAnimated:YES completion:NULL];
}
这篇关于popToViewController的用法已经关闭所ViewController的方法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!