当用户单击“退出按钮"时,如何重置iOS应用程序? [英] How to reset an iOS application when a user clicks the "sign out button"?

查看:52
本文介绍了当用户单击“退出按钮"时,如何重置iOS应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个iOS应用程序,在该应用程序中,向客户显示退出"按钮,因为客户端希望该按钮在那里.

I am designing an iOS application where a user is presented a "sign out" button as the client wants that to be there.

但是我在逻辑研究方面很艰难.

However I am having a tough time working through the logic.

我应该:

1).此时退出应用程序,因为整个应用程序都在经过身份验证的Web服务调用的前提下运行.(如果是这样,我如何退出我的应用程序?)

1). exit the application at that point since the entire app runs on the premise of authenticated web service calls. (if so how do I make my app exit? )

2).将用户带到初始启动屏幕,在该屏幕上,他/她可以选择登录/注册.(如果是这样,如何将应用重置为初始屏幕?)

2). Take the user to the initial splash screen where he/she is given the choice of login/register. (if so how do I reset the app back to initial screen?)

我知道我要问的是令人困惑的,所以我希望我有道理.

I know what I am asking is confusing so I hope I am making sense.

推荐答案

不建议从应用程序退出.它将给用户带来应用程序崩溃的感觉.您可以使用第二种方法,在用户退出后将其发送回初始登录屏幕.如果您使用的是基于导航控制器的方法,则可以尝试使用 popToRootViewController 方法返回登录屏幕(假设登录屏幕是您的根).

Exiting from the app is not recommended. It would give the feeling of app crash to the user. You may use the second approach of sending the user back to the initial login screen after he sign outs. If you are using a navigation controller based approach you can try using popToRootViewController method of going back to the login screen(assuming login screen is your root).

这篇关于当用户单击“退出按钮"时,如何重置iOS应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆