Search code examples
iosobjective-cdropboxuidocumentpickerviewcontroller

UIDocumentPickerViewController: Open folder from Dropbox


How can I use UIDocumentPickerViewController to let the user select a folder from their Dropbox?

If I call this, I can browse for folders, but the Dropbox folder is greyed out:

[[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[(__bridge NSString*)kUTTypeFolder]
                                                       inMode:UIDocumentPickerModeOpen];

If I change the mode to UIDocumentPickerModeImport, I get an Assertion failure and it crashes. It seems that Import doesn't work together with kUTTypeFolder. If I keep Import and set the types to @[kUTTypeFolder, kUTTypeImage], I get access to the Dropbox, but the picker only lets me select images, not folders.

Any help or advice would be appreciated!


Solution

  • The Dropbox iOS app 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.