@OOper thanks for testing.
My development environment is: macOS 11.0 Beta
Xcode 12.0 Beta
iPad Pro (2nd Gen) + iPadOS 14.0 Beta
Post
Replies
Boosts
Views
Activity
I tested with my iPhone XS + iOS 13.5.1, which worked fine.
Like you said, It's highly likely that it's a bug of iOS 14.
Thanks again for your help.
Finally it worked on my iPad too after updating to iPadOS/Xcode beta 2.
Actually it didn't work on the first try, then I added one line inside updateUIViewController, and now it works!
func makeUIViewController(context: Context) -> UIDocumentPickerViewController {
let picker = UIDocumentPickerViewController(documentTypes: [kUTTypeImage as String], in: .open)
picker.allowsMultipleSelection = true
return picker
}
func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) {
uiViewController.allowsMultipleSelection = true
}
The weird thing is it still works correctly even after I remove the line in updateUIViewController...
Anyway, thanks for your help @OOPer and @marlonjames.