I’m currently providing my own file browsing UI including thumbnails, file operations (like rename, delete, copy, move) and iCloud Drive synching in my app. With the last update I changed the deployment target to iOS 11, and I am thrilled to utilize the UIDocumentBrowserViewController ... but my app heavily relies on “related items”:
Each main file is accompanied by a second file including meta data, which has the same name, but a different extension. Currently my app defines the second file as a related item, ensuring proper file coordination. In all file operations both files are handled synchronously, e.g. renaming or deleting both files.
Is there any way to accomplish this with a UIDocumentBrowserViewController? Although I can overwrite corresponding UIDocument’s methods to read / write both files, I found no way to hook into these file operations. Unfortunately I am not in the position to define a directory file wrapper as the main file needs to remain visible and easily accessible in the file structure.
Any help - including pointers to some more detailed documentation - is appreciated. I watched the related WWDC sessions and read Apple’s documentation, but found it quite basic.
Eliminating >50% of my code and add various cloud storage providers is just too compelling.
Just for your information: I've decided to use extended file attributes to store the meta data which is currently reflected in the related items. Gives me some challenges for a proper migration, but is IMHO the right approach to store this kind of information ... and will harmonize with UIDocumentBrowserViewController. Unfortunately I hadn't this idea 10 years back when I started using these files.