I need the user to select only images and pdf files from UIDocumentPicker & want to check which type of file user has selected in the DocumentPicker delegate method
I have used this but this allow everything
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.content","public.data"], in: .import)
You can use
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.composite-content"], in: .import)
this will only allow pdf files to import