4
  • The app's container is public, so it is visible in iCloud Drive.
  • The app displays files in its public iCloud container.
  • The app can I also present the UIDocumentPickerViewController with UIDocumentPickerModeImport mode so users can import files from other containers.

But I do not want users to be able to import files from the app's own container. These are already visible in the app using NSMetadataQuery.

How can I prevent this?

  • The container must be public so it is visible from iCloud Drive on the desktop. So hiding it is not an option.
  • I could use UIDocumentPickerModeOpen instead, because then I can examine the fileURL and see that the selected item is within the app's container.
  • I was hoping I could create an NSMetadataQuery from the url given by the UIDocumentPickerViewController and then check the NSMetadataUbiquitousItemIsExternalDocumentKey attribute. But I haven't managed to do that.
Karmeye
  • 1,399
  • 1
  • 8
  • 16

0 Answers0