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.
Asked
Active
Viewed 160 times
0
-
1Try implementing previewController(_,editingModeFor:) although I don’t remember if that won’t let the user edit anyway and save the edits to Files – Thomas Deniau Aug 17 '22 at 12:56
1 Answers
0
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.

Nikunj
- 655
- 3
- 13
- 25