Dominik
Dominik

Reputation: 756

Using fileImporter to import cloud folders

I'm using fileImporter to let the user select a folder:

.fileImporter(
    isPresented: viewStore.binding(\.$fileImporterPresented),
    allowedContentTypes: [.folder],
    allowsMultipleSelection: false
) { resources in
    // Do something
}

On macOS 13 (SwiftUI, not Catalyst) everything works as expected.

On iOS 16.1 it shows an open action for a folder but I cannot access Dropbox.

When I add additional allowedContentTypes like .directory, or .volume then Dropbox is no longer greyed out but it is also no longer possible to select a folder:

Selecting a folder seems to only work when the only allowedContentType is .folder.

How do I configure fileImporter to select a folder on an iOS external cloud storage provider?

Upvotes: 1

Views: 1046

Answers (1)

Dominik
Dominik

Reputation: 756

The problem seems to be with Dropbox not implementing NSExtensionFileProviderSupportsPickingFolders. That's why it's greyed out in the fileImporter but also in the UIDocumentPickerViewController.

More information: https://stackoverflow.com/a/71379422/225833

Upvotes: 1

Related Questions