我需要用户仅从uidocumentPicker&想检查在documentpicker委托方法中选择了哪种类型的文件用户
我已经使用过,但是这允许所有内容
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.content","public.data"], in: .import)
您可以使用
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.composite-content"], in: .import)
这只会允许PDF文件导入
您可以使用核心服务进行此工作
导入核心
然后输入这样的类型
让importMenu = uidocumentPickerviewController(documentTypes:[kuttypepdf as string,kuttypepepng as String as String,kuttypejpeg as string as String as String],in:.import))
或没有核心服务
让importMenu = uidocumentPickerviewController(documentTypes:[com.adobe.pdf; public&quort&quot&quot&quot&quot&quot" public.jpeg';