当互联网不可用时关闭应用程序 [英] Close app when internet is not available

查看:127
本文介绍了当互联网不可用时关闭应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在互联网连接不可用时关闭我的应用。

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.

这篇关于当互联网不可用时关闭应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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