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的主要内容,如果未能解决你的问题,请参考以下文章

对话框--pop&dialog总结

APP了 Watch的简单代码

对这个带有 & 不带 = 的代码片段返回类型感到非常困惑

如何解决'已关闭的可关闭小部件仍是树的一部分。'颤抖中

VC方法调用顺序

Sphinx - 在代码块片段中使用省略号 (...)