Closed eldare closed 5 years ago
I recommend you retrieve anything from the app bundle with Apple's native Bundle
API since it's tied to the target which calls it. Meaning if I call Bundle.main
from Disk, it will get the file from the Disk target and not your app's. Once you have the url from the Bundle
API, it's up to you how you want to deserialize that data.
Also, you can read the app bundle's file, but you can't write to it, so it's kind of an anti-pattern for Disk. If you want to modify a file read from the app bundle, you need to first read it (with the Bundle
API), save it to the documents directory (with Disk) and then you can read/write the file after this initial set up work.
Are there plans to support reading files from app's bundle? thanks.