I am using below code for showing the document picker.When i show the picker i use below code
let documentPickerController = UIDocumentPickerViewController(documentTypes: [String(kUTTypeText), String(kUTTypePDF), String(kUTTypePNG), String(kUTTypeJPEG), String(kUTTypePlainText), String(kUTTypeImage)], in: .import)
Above code shows me the all files in my iCloud but it does not let me select the doc,docx files.These files appear as disabled.
But when i addd "public.data"
as element in UIDocumentPickerViewController
constructor then it is allowing me select doc,docx file & file does not appear as disabled.
Please tell me why this is happening ?
To be able to select doc and docx, you have to use public.data.
kUTTypePlainText only allows files of .txt type
To allow only doc give "
com.microsoft.word.doc
"For more information: System-Declared Uniform Type Identifiers