直接返回到第一个视图
[self.navigationController popToRootViewControllerAnimated:YES];
返回到指定索引的视图
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2] animated:YES];
返回你想到的类
for (UIViewController *controller in self.navigationController.viewControllers) {
if ([controller isKindOfClass:[你要跳转到的Controller class]]) {
[self.navigationController popToViewController:controller animated:YES];
}
}
如果是present到某个界面的
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil]//返回上面两个界面