I am developing an app in swift and Xcode , I use Core Data .
Already in tests, when I leave the app in the background normally nothing happens but sometimes (a long time inactive: 18 - 24 hours) it does not start neither the app in the background nor starting it again.
In the viewWillDisappear what I do is save the data that has not yet been saved from the current game.
Note: while the app has been in the background practically the iPhone has not done anything, so in didReceiveMemoryWarning it should not happen although I also keep the data in play.
I really do not know what to do in viewWillDisappear
Thanks