How to remove the edit button of QLPreviewController(swift)?

378 Views Asked by At

I'm using QLPreviewController to present PDF files, but there is an edit button on the right of the navigation bar(right top of screen). I don't want the edit button . How can I remove it? I found I can't customize the navigation bar right button of QLPreviewController.

1

There are 1 best solutions below

0
Nikunj On

If you want to disable edit button in right side of NavigationBar BarButton,set delegate of QLPreviewController and

Try this delegate method:

func previewController(_ controller: QLPreviewController, editingModeFor previewItem: QLPreviewItem) -> QLPreviewItemEditingMode {
    return .disabled }

This will hide editing and remove the edit icon next to the search icon. this is work for me in iOS 15.