I'm looking to get my iOS app to cache file data in a place where the user cannot access it directly but it stays cached until the user chooses to clear it.
The ideal solution would be to a place where it appears in "Settings > iPhone Storage > AppName > Recommendations" even though I already provide a mechanism to clear it from within the app.
At the moment I'm caching the data into "/var/mobile/Containers/Data/Application/EF5B1643-C28D-4D0B-8DC6-23FFF1BEE4B8/Documents/../Library/Preloads" but it seems to intermittently get cleared by the OS.
Looking at the following document https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html this seems to be a valid location that shouldn't be getting cleared automatically by the OS.
Where should I be writing cache files so they:
1) Are not directly accessible to the users
2) Appear in the Settings > iPhone Storage > AppName > Recommendations section
3) Stay cached until the user specifically chooses to clear them (either from the app or the Recommendations section) and are not cleared automatically by the OS
4) Are not backed up by iTunes or iCloud