Ios Developer
Ios Developer

Reputation: 888

Editing option for pdf is not showing in ios12 using QuickLook

I am using QuickLook for opening and editing pdf in swift. It is working fine in ios 14 but the editting option is not showing in ios 12. i am attaching the screen shot of my simulator. In this image the editing of is there but if i am running it in any ios12 device like iphone 5s it is not showing

//MARK:- QLPreviewControllerDataSource
@available(iOS 13.0, *)
extension AllPdfFilesViewController: QLPreviewControllerDataSource {
    func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
        return 1
    }
    
    func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
        
        return self.previewItem as QLPreviewItem
    }
}

//MARK:- QLPreviewControllerDelegate

@available(iOS 13.0, *)
extension AllPdfFilesViewController: QLPreviewControllerDelegate {
    func previewController(
        _ controller: QLPreviewController,
        editingModeFor previewItem: QLPreviewItem
    ) -> QLPreviewItemEditingMode {
        .createCopy
    }
}

enter image description here

Upvotes: 0

Views: 81

Answers (1)

ngb
ngb

Reputation: 891

This functionality was only introduced in iOS 13. so it won't work on 12.

Upvotes: 1

Related Questions