0

I am trying to remove all the right-side BarButtonItem in QuickLook (QLPreviewController) in iOS 15 and Xcode 13.2 and later.

My requirement is to only show search button in right-side of navigation bar. I tried many types of solutions but I'm not able to meet this requirement. I also read QuickLook Document provided by Apple but I'm not having success. For more understanding show this Apple document: Apple QuickLook Document Link.

This is the image

HangarRash
  • 7,314
  • 5
  • 5
  • 32
Nikunj
  • 655
  • 3
  • 13
  • 25

1 Answers1

0

If you want to remove the ability to edit a document while using QLPreviewController, you need to implement the previewController(_:editingModeFor:) delegate method.

Make sure you set the delegate property of your QLPreviewController (along with the dataSource).

Then implement:

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

This will disable editing and remove the edit icon next to the search icon.

HangarRash
  • 7,314
  • 5
  • 5
  • 32
  • can you provide me other solution of this, I want to remove down Arrow behind document title and also remove more button option copy action on click doc thumb option, this is show in **IOS 16.2** @HangarRash – Nikunj Feb 01 '23 at 10:00