1

using a UIDocumentPickerViewController in .import mode on iCloud Drive sometimes returns files with a .icloud extension. This extension means that the file are not physically present on the device, but on iCloud.

Since the mode is .import, the files returned by documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) are a copy of the actual files. Therefore, it becomes impossible to call startDownloadingUbiquitousItemAtURL on NSFileManager.

One precision that might (maybe) be important: this happens when the user selects a directory in the startDownloadingUbiquitousItemAtURL. In the callback I then perform FileManager.default.enumerator(at: urls[0], includingPropertiesForKeys: nil) which returns the list of files inside the directory. Some of those files unfortunately are sometimes .icloud files, not the actual files.

Somehow, I can't find a workaround to access those files, any idea ?

Thanks !

vomi
  • 993
  • 8
  • 18

1 Answers1

0

According to Apple, this is a bug on their side. .icloud files should not be returned.

vomi
  • 993
  • 8
  • 18