我想在互联网连接不可用时关闭我的应用。
I want to close my app when an Internet connection is not available.
我检查一下,但是如何创建警报,然后关闭我的应用程序?
I check that, but how can I create an alert, and then close my app?
推荐答案您不应强行关闭应用程序,因为终止应用程序的标准方法是按主页按钮(或使用多任务栏)
You shouldn't force close an app as the standard way to terminate an application is to press the home button (or use the multitasking bar)
不以编程方式退出永远不要以编程方式退出iOS应用程序,因为人们倾向于将解释为崩溃。但是,如果外部环境阻止您的应用程序按预期运行,您需要告诉您的用户有关情况并解释他们可以对此做些什么。 根据应用程序故障的严重程度,您有两个选项。 Don’t Quit Programmatically
Never quit an iOS application programmatically because people tend to interpret this as a crash. However, if external circumstances prevent your application from functioning as intended, you need to tell your users about the situation and explain what they can do about it. Depending on how severe the application malfunction is, you have two choices.
显示一个有吸引力的屏幕,描述问题并建议一个更正。一个屏幕提供反馈,让用户放心您的应用程序没有任何问题。它让用户掌控,让他们决定是否要采取纠正措施,继续使用你的应用程序或按Home键并打开不同的应用程序
Display an attractive screen that describes the problem and suggests a correction. A screen provides feedback that reassures users that there’s nothing wrong with your application. It puts users in control, letting them decide whether they want to take corrective action and continue using your application or press the Home button and open a different application
如果只有部分应用程序的功能无效,请在人们激活该功能时显示屏幕或警报。显示警报只有当人们试图访问不是功能的功能时。
If only some of your application's features are not working, display either a screen or an alert when people activate the feature. Display the alert only when people try to access the feature that isn’t functioning.
源
更多推荐
当互联网不可用时关闭应用程序
发布评论