简体   繁体   中英

Not able to get .doc file from UIDocumentPickerViewController ios swift

I'm using this code to get document from iCloud in my app.

let documentPicker: UIDocumentPickerViewController = UIDocumentPickerViewController(documentTypes: ["public.content","public.data"], in: UIDocumentPickerMode.import)
    documentPicker.delegate = self
    documentPicker.modalPresentationStyle = UIModalPresentationStyle.fullScreen
    if let popoverPresentationController = documentPicker.popoverPresentationController {
      popoverPresentationController.sourceView = sender
    }

    self.present(documentPicker, animated: true, completion: nil)

I want three type of document from iCloud namely .pdf, .doc, .docx. I'm able to get PDF files but not the .doc files from icloud I'm giving proper UTIs for the files types ie "public.content","public.data". These UTIs are given here on the page apple Documentation . public.data confirms for doc files but still I'm not able to get the doc files.

根据这一点,您必须将com.microsoft.word.doc用于doc类型,以希望它能起作用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM