UIDocumentPicker in iOS 13 will not support UTI for Folders

iOS 13 has support for selecting and importing files inside of the UIDocumentPicker.


Initializing the document picker with UTIs for directory subtypes does not yet selectable folders inside of the document picker:


NSArray* documentTypes = @[@"public.image", @"public.folder", @"public.volume", @"public.directory"];
  UIDocumentPickerViewController* pickerVC = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:documentTypes inMode:UIDocumentPickerModeOpen];

Images are selectable in the document picker UI, but folders/directories are not showing as selectable.

Replies

I am also having this issue 😟, have you come up with a workaround?

I don't think you can mix files and folders, as it shows a completely different dialog for selecting a folder. I have had to implement folder and file selection as two separate options: https://developer.apple.com/documentation/uikit/view_controllers/providing_access_to_directories

I believe this is an iOS 13 regression. If you run that code on iOS 12 it works as expected. Running on iOS 13 does not able you to select the directories. I filed a bug report for this issue. `FB7486859`