My iOS app displays text content loaded from data files. Some of these data files will be bundled with the app. Others will be downloaded from my server. They are all JSON files, and have the same structure.
I want all of these data files to be placed in the same directory. So far, I've just been dragging the bundled files into an Xcode group folder. How would I create a special directory for them? i.e. one that would be part of the directory structure of the app itself?
What I'd like to do is have a directory called Data where both bundled and downloaded data files would reside.
I should add that I want the user to be able to delete the files if they wish. Some of them are huge, and they may want to save space on their device.
You can’t delete files from within your app’s bundle. The iOS sandbox won’t allow it and, even if it did, it’d break the seal on your app’s code signature.
That requirement suggests two alternatives:
Don’t include these files in your app’s bundle, but instead download them on request.
Adopt on-demand resources.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"