How to “restart” application ios

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 04:59:42

问题


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.

How could I do this?

thanks


回答1:


OK, because you haven't been clear about your navigation patterns, I'll show the two kinds of transitions and their opposites:

Push-Pop: Is created by pushing a new UIViewController onto the navigation stack using

[self.navigationController pushViewController:exampleController animated:YES];

It is counteracted by

[self popToRootViewControllerAnimated:YES];

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];

from within the modal view itself.



来源:https://stackoverflow.com/questions/10067113/how-to-restart-application-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!