Reputation: 46479
Assume a game app, where user loads some contents into memory during first open. Afterwards they can:
Is there a way to know when our app's contents are no longer in memory or something of similar sorts to determine when re-caching of assets is required?
I studied few game apps and they tend to do one of the following
And I'm interested in achieving no.2 to not show loading screens unnecessarily each time app comes back from the background.
Upvotes: 1
Views: 248
Reputation: 624
You can use AppDelegate method applicationWillTerminate
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623111-applicationwillterminate
And notification willTerminateNotification
https://developer.apple.com/documentation/uikit/uiapplication/1623061-willterminatenotification
If Application not terminate you don't need show any loading screen.
Upvotes: 1