Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exit an application or Go to Dash board(main page) programmatically - IOS

I want to exit my application programatically, I googled, some people suggesting to use exit(1), but apple is not supporting that I guess. If it is the case, How do I exit my application programatically. Any helps appreciated.

like image 786
Newbee Avatar asked Dec 04 '22 14:12

Newbee


1 Answers

exit(0); will work but don't use it

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

like image 191
James Webster Avatar answered Mar 09 '23 00:03

James Webster