I need to close the application whenever user taps on the button(i need to keep IBAction for closing the app).Like in games menu we have exit button when we tap on it we come out from the game.Same thing i need.How can i do this .Thanks in advance
Please see: How do I programmatically quit my iPhone application?
WARNING: It is possible to quit the application by calling exit. Applications calling exit will appear to the user to have crashed, rather than performing a graceful termination and animating back to the Home screen. Such usage provides a negative experience and is strongly discouraged.
Instead of it, If you want your app to terminate when the user presses the home button, set the value of UIApplicationExitsOnSuspend
to YES
in your app's Info.plist
file. If you do this, when the user taps the home button the applicationWillTerminate:
method of your app delegate will be called and then your application will terminate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With