I am trying to open a PDF from the app in QLPreviewController. Following is the code:
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
return getFileURLFromFileModel()! as QLPreviewItem
}
func displayPDFForAnnotation(){
let previewController = QLPreviewController()
previewController.dataSource = self
self.present(previewController, animated: true)
}
It's behaving as expected. Then if I add an annotation, that is, if I edit the PDF and then press the "Done" button, then it's asking to "Save to Files"
Here is the image for reference:

I don't want the option of "Save to Files" as it would be saved within the app on the press of "Done" button itself. How can I hide the "Save to Files" option from the "Done" button menu?
You should implement the delegate method
previewController(_:editingModeFor:).The documentation states:
Note that if you want the original PDF to be updated when the user saves, make sure the PDF is writable. This means that it can't be a PDF stored in the app's resource bundle.