pop&dismiss
Posted wycstudy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pop&dismiss相关的知识,希望对你有一定的参考价值。
1 //dismiss到根视图 2 - (void)dismissToRootViewController{ 3 UIViewController *vc = self; 4 while (vc.presentingViewController) { 5 vc = vc.presentingViewController; 6 } 7 [vc dismissViewControllerAnimated:YES completion:nil]; 8 }
1 //dismiss到指定界面 2 UIViewController *vc =self.presentingViewController; 3 while (![vc isKindOfClass:[[UIApplication sharedApplication].keyWindow.rootViewController class]]) { 4 vc = vc.presentingViewController; 5 } 6 [vc dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:YES];//pop到根视图
1 for (UIViewController *controller in self.navigationController.viewControllers) { 2 if ([controller isKindOfClass:[WekeWordLockViewController class]]) { 3 WekeWordLockViewController *vc = (WekeWordLockViewController *)controller; 4 [self.navigationController popToViewController:vc animated:YES]; 5 } 6 }
以上是关于pop&dismiss的主要内容,如果未能解决你的问题,请参考以下文章