Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When picking a folder from UIDocumentPickerViewController, third-party file providers are grayed out?

Tags:

ios

swift

I have a UIDocumentPickerViewController with a filetype of "public.folder" (I've also tried kUTTypeFolder), where a user can pick a default directory for files to be saved. It pulls up the correct UI for selecting folders, however, all third-party providers (Google Drive, Dropbox, etc.) are all grayed out and can't be selected. I can select iCloud Drive and On My iPhone just fine.

Here's my function for showing the controller:

@IBAction func pickDefaultDirectory(_ sender: Any) {
    let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.folder"], in: .open)

    documentPicker.delegate = self

    self.present(documentPicker, animated: true, completion: nil)
}

This is what every "pick folders via UIDocumentPickerViewController" article I've found says to do, but I've had no luck. Does anyone know why this is happening? Am I just forgetting something in there?

like image 677
turquoisehexagonsun Avatar asked Oct 07 '19 02:10

turquoisehexagonsun


1 Answers

According to Dropbox developers, this isn't supported at the moment.

The Dropbox document picker doesn't support opening folders, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

Dropboxforum

like image 102
Bassebus Avatar answered Nov 15 '22 00:11

Bassebus