How do I programmatically quit my iOS application

How do I programmatically quit my iOS application

Home button is done for that.

So, UI guidelines advise that you alert and ask user to hit home button. That's not really programmatically, but that's the guidelines.

In which circumstances do you want to quit programmatically ?


But, if that's just for testing, exit(1) forces a brutal exit, without sasving anything.


Note: this should not be on the app released to the Appstrore (would cause rejection)

See:

h ttps://developer.apple.com/library/content/qa/qa1561/_index.html

How do I programmatically quit my iOS application
 
 
Q