I am new to ios developement, i am trying to display file with different format (ex. docx,doc,pdf,csv) , it is working fine with .pdf files but for .doc files its not previewing.enter image description here
This is what showing in simulator
For some .doc files & pdf it works!!1
code :
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func handlePress(){
let previewController = QLPreviewController()
previewController.dataSource = self
present(previewController, animated: true)
}
func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
return 3
}
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
guard let url = URL(string: "**urlpath**/q.DOC") else {
fatalError("Could not load")
}
return url as QLPreviewItem
}