What happens to unsaved data after app goes to the background in iOS

Hi,


For how long does the data entered in a certain app lasts after the app is closed and in the background?


In other words, if I have an app which allows the user to enter items into a tableview but the app does NOT have a way to persist the data, such as coredata, UserDefaults, Realm etc. and the user closes the app after he/she entered a few items into the table, for how long does that data will be available? When does iOS will purge that data?


Can someone explain what happens to unsaved data once the app has been closed?

Accepted Reply

iOS will purge your app (and its data) when some other process wants that memory.

So the answer to your question of "How long will the data last?" is "How long until your boss fires you?"

Replies

iOS will purge your app (and its data) when some other process wants that memory.

So the answer to your question of "How long will the data last?" is "How long until your boss fires you?"

Make sense, I also found this link which states the same thing. Thanks a lot.

https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html