A host app opens the system Document Picker in folder-selection mode (on iOS this maps to UIDocumentPickerViewController initialized for UTType.folder; in SwiftUI it’s .fileImporter(allowedContentTypes: [.folder])). In this mode, iCloud Drive and Dropbox are selectable, but Seafile’s storage location is greyed out / not selectable.
Root cause
Whether a storage provider can be picked is decided by that provider’s File Provider extension, not by the host app. To be selectable when the picker asks for a directory, the extension must fully support directory (folder) operations. If it only implements file-level support, the system greys the provider out in folder mode.
What the Seafile developer needs to implement (File Provider framework)
1. Expose folders as navigable items
• NSFileProviderItem for directories must report the content type UTType.folder (public.folder) via contentType.
• The item hierarchy (parentItemIdentifier, itemIdentifier) must be correct so folders can be traversed.
2. Directory enumeration
• Provide a working NSFileProviderEnumerator (via enumerator(for:request:)) for container/folder identifiers, not just for files.
• Implement enumerateItems(for:startingAt:) (and change tracking where applicable) so the picker can list folder contents.
3. Correct capabilities on folder items
• Set the appropriate NSFileProviderItemCapabilities on directory items, at minimum .allowsContentEnumeration (and .allowsReading), so the system treats them as selectable directories.
4. Security-scoped access for directories
• Ensure the extension can vend a security-scoped URL/bookmark for a folder so the host app receives a valid, persistable directory URL (startAccessingSecurityScopedResource must work for the returned directory).
5. Materialization / on-demand availability
• Handle the case where a folder isn’t downloaded yet, so folder selection works without the contents being fully materialized.
How to verify the fix
• Host app requests [.folder] → Seafile should be selectable, and the returned URL should be a valid, security-scoped directory the app can enumerate and bookmark.
• As a diagnostic: if the host app instead requests a file type (e.g. [.pdf]), Seafile is likely already selectable today — confirming that only the directory path is missing.
Reference
Apple – File Provider framework: NSFileProviderExtension / NSFileProviderReplicatedExtension, NSFileProviderItem, NSFileProviderEnumerator, NSFileProviderItemCapabilities.