Arun K
Arun K

Reputation: 840

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 i.e. "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.

Upvotes: 0

Views: 1353

Answers (1)

Hossein
Hossein

Reputation: 847

according to this you must use com.microsoft.word.doc for doc types hope it works.

Upvotes: 3

Related Questions