如何“重新启动"应用ios [英] How to "restart" application ios
问题描述
因此,我有一个应用程序,用户可以通过3个视图控制器,然后将图片提交到Facebook.在他们将其提交到Facebook之后,我希望他们能够选择重新启动该过程,就像他们重新启动了该应用程序一样.
So I have an app where a user goes through 3 view controllers and then submits a picture to Facebook. After they submit it to Facebook, I want them to be able to choose to restart the process over again, as if they had re-launched the app.
我该怎么办?
谢谢
推荐答案
好吧,因为您对导航模式的了解并不明确,所以我将展示两种过渡及其对立:
OK, because you haven't been clear about your navigation patterns, I'll show the two kinds of transitions and their opposites:
Push-Pop :通过使用
[self.navigationController pushViewController:exampleController animated:YES];
它被
[self popToRootViewControllerAnimated:YES];
模式视图:通过在当前视图上显示一个新的UIViewController来创建.
Modal View: Is created by presenting a new UIViewController over the current one.
[self presentModalViewController:exampleController animated:YES];
它不在导航堆栈上,因此无法在第一个模态视图中显示另一个模态视图.通过调用
It is not on the navigation stack, so the possibility of presenting another modal view within the first modal view is not available. It is counteracted by calling
[self dismissModalViewControllerAnimated:YES];
从模式视图本身内部.
这篇关于如何“重新启动"应用ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!