Our iOS app needs to import either all files within a chosen directory OR from a zip file. I managed to get UIDocumentPickerViewController to select folders with this bit of code:
auto picker = [[UIDocumentPickerViewController alloc]
initForOpeningContentTypes:@[ UTTypeFolder ]];
picker.delegate = self;
But I want to also allow the user to select a single ZIP file instead of a folder if they wish. I thought I could add another UTType to the array of content types, but that did not work:
auto picker = [[UIDocumentPickerViewController alloc]
initForOpeningContentTypes:@[ UTTypeFolder, UTTypeZIP ]];
picker.delegate = self;
It does allow a ZIP file to be selected, but you can no longer select a folder. Is there anyway to do this in iOS? Note that I will need the side-effect of chosing a folder that it gives security permissions to recursively descend into the folder.
Also, is there anyway to customize the text that appears in the UIDocumentPickerViewController view? It says "Choose a location" and then "Access will be granted to ...". I really want some additional text to instruct the user such as "Please select a ZIP file or a folder".