0

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.

Anonymous
  • 15
  • 5

1 Answers1

2

run the function in applicationDidEnterBackground or 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

Mentos
  • 483
  • 1
  • 4
  • 14