0

I'm looking for an iOS API that allows accessing a user-selected folder in place (without importing it). It seems to be possible with native frameworks from Apple. How I expect it to work:

  1. User selects a folder using the native document picker.
  2. App gets access to the folder and can read and write its content.
  3. Access is persisted when the app is killed and restarted.

This functionality can be seen in the LumaFusion app. The feature is called "Linked Folders". It allows to add user-selected folders with a native document picker, which are then available for the app. The app can load assets from the previously selected folders. The content of the linked folders is not copied, so it's not an import. External changes to the content of linked folders are immediately visible in the app. Access to the folders is persisted, even if the app is killed and restarted, so the user won't have to choose the folder again.

Any hints of which API can be used to implement such a feature will be appreciated. I would also love to learn if there are any limitations, like the kind of the selected folders, will it work with any destination, including iCloud Drive and third-party file providers, etc. I believe it has to be documented somewhere but can't find the correct Apple Documentation page.

Darrarski
  • 3,882
  • 6
  • 37
  • 59

1 Answers1

0

Not sure why I missed it previously, but it seems this documentation answers my question:

Providing Access to Directories

  1. Use UIDocumentPickerViewController to get access to the user-selected directory URL.
  2. Save the URL as a Bookmark for later using bookmarkData method.
  3. Use startAccessingSecurityScopedResource and stopAccessingSecurityScopedResource methods when accessing the bookmarked URL content.
Darrarski
  • 3,882
  • 6
  • 37
  • 59