Skip to content

Cannot select Cryptomator folder in SwiftUI file importer #382

@nickasd

Description

@nickasd

Please agree to the following

Summary

The SwiftUI file importer doesn't allow to select folders in a Cryptomator vault

System Setup

  • iOS: 18.0
  • Cryptomator: 2.6.2

Cloud Type

iCloud Drive

Steps to Reproduce

  1. Run a SwiftUI app with the following content:
struct ContentView: View {
    @State private var isPresentingUrlPicker = false
    @State private var label = ""
    
    var body: some View {
        VStack {
            Button("Open") {
                isPresentingUrlPicker = true
            }
            Text(label)
        }
        .fileImporter(isPresented: $isPresentingUrlPicker, allowedContentTypes: [.folder, .data]) { result in
            do {
                let url = try result.get()
                let _ = url.startAccessingSecurityScopedResource()
                label = url.path
                url.stopAccessingSecurityScopedResource()
            } catch {
                label = error.localizedDescription
            }
        }
    }
}
  1. Tap on the Open button.
  2. Select a folder in a Cryptomator vault.

Expected Behavior

The Open button of the file importer should be enabled.

Actual Behavior

The Open button of the file importer is disabled.

Reproducibility

Always

Relevant Log Output

No response

Anything else?

I cannot reproduce the issue myself since I don't have Cryptomator for iOS. I became aware of this through a customer of my app which allows to select folders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions