I'm working on an app where you log down what you eat. I have my app set to save the information to my MySQL server every time I close the view (like go back a step in the Navbar) or press the home button. How can I run my saving function down when you turn off the phone.
run the function in
applicationWillResignActive in your
AppDelegate depending on which one you require.
applicationWillResignActive if you want to save even if the app is interrupted by for example a phone call