Created
January 22, 2016 13:22
-
-
Save aplekhanov/d62bebe89ab6e6b4037a to your computer and use it in GitHub Desktop.
Programmatically exit from iOS app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// not for app store apps, 'cause wil be rejected !!! | |
// can be useful for in-house development needs | |
UIApplication *app = [UIApplication sharedApplication]; | |
[app performSelector:@selector(suspend)]; | |
// wait two seconds while app is going to background | |
[NSThread sleepForTimeInterval:2.0]; | |
// when exit app when it is in background | |
exit(0); | |
// app screenshot still will be at mulitask view | |
// but it's only show recent apps | |
// actually, you've exit from current app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment