我目前正在开发一个应用程序,它以模式方式显示屏幕和另一个定制进度指示器。是否可以无缝地返回到根视图控制器?
家庭->屏幕1->screen2(自定义progressIndicator)
我想取消自定义的progressIndicator (和屏幕显示模式),并返回到我的家庭(根)视图控制器一次。
self.navigationController?.popToRootViewControllerAnimated(true)谢谢你的帮助!
发布于 2015-12-17 04:34:39
您需要取消提供的模型,然后您可以弹出所有的推送视图控制器。如所示,模型将不在导航堆栈中。
self.dismissViewControllerAnimated(true, completion: {});然后您可以弹出到基本视图控制器。
self.navigationController.popViewControllerAnimated(true);发布于 2017-10-03 13:43:52
Swift 4
self.dismiss(animated: true, completion: {});
self.navigationController?.popViewController(animated: true);发布于 2017-07-31 09:16:52
在Swift 3中,这将起作用:
self.dismiss(animated: true, completion: {});
self.navigationController?.popViewController(animated: true);https://stackoverflow.com/questions/34326632
复制相似问题