Close app when internet is not available

后端 未结 4 1030
北荒
北荒 2020-12-16 23:19

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?

4条回答
  •  离开以前
    2020-12-16 23:56

    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)

    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.

    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.

    Source

提交回复
热议问题