I'm trying to add iCloud Drive functionality to my iPhone app, by providing 2 features:
- import a document which is stored on iCloud Drive to my local app
- export a document from local store to iCloud Drive
The first part is done, and it was pretty easy. I used UIDocumentPicker
with UIDocumentPickerModeImport
to obtain a file url, which I just read to use the document in my app.
The second part, however, kind of confuses me. If I understand it correctly, all I have to do is instantiate a UIDocumentPicker
with the file url of some document from the app local store, and the UIDocumentPicker
will do all the rest (= saving to iCloud Drive, in case the user picks a location there).
Is this correct? Because this is what I've implemented. And while the files show up in the folder from picker selection, they will not sync neither to my Mac nor to www.icloud.com. So it seems like they are somehow stored in "the document picker on my phone", whatever this means.
Am I doing something wrong? The file I copied to the iCloud Drive folder on my mac perfectly showed up in the import-picker on the iPhone.