I can't figure how to select multiple documents in the UI when allowsMultipleSelection is true. What did I miss?
The code that presents the controller:
let controller = UIDocumentPickerViewController(documentTypes: [kUTTypeItem as String], in: .import)
if #available(iOS 11, *) {
controller.allowsMultipleSelection = true
}
controller.delegate = self
present(controller, animated: true)The delegate, that is actually called (with a single URL):
@available(iOS 11, *)
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
print(urls)
}My app is compiled for iOS 10&11 and is running on iPhone 6 Plus with iOS 11.0.3. Step-by-step debugging proves that code is called as expected. I've tried selecting files from iCloud drive and Documents (a document sharing app) but the behavior is always the same: the document picker closes as soon as I tap a single file. Long touch provides no help.