iOS返回根视图的方法
2016-10-10 本文已影响0人
39af7ce2a2d1
1.导航栏返回根视图
[self.navigationController popToRootViewControllerAnimated:YES];
2.导航栏返回特定视图
for (UIViewController *controller in self.navigationController.viewControllers) {
if ([controller isKindOfClass:[要返回的类名 class]]) {
[self.navigationController popToViewController:controller animated:YES];
}
}
3.dissmiss 返回根视图
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:NO completion:nil];