QLPreviewController with SwiftUI

I'm having a problem where any buttons won't be shown when displaying a QLPreviewController with swift.

With .quickLookPreview() these buttons are shown, including share, done, annotation etcetera. The buttons are not shown when using QLPreviewController with SwiftUI, however if used with other UIKit they are shown.

How to fix this? I'm not really looking forward in implementing all of the annotation functions and other QuickLook capabilities again.

The ultimate goal of mine is to allow annotation and other pdf editing with the ability to save the file via the Done button, but on .quickLookPreview() the Done button displays "Save to files" and "Discard" and on QLPreviewController the button is not shown.

The issue has been addressed on several forums, yet a solution has not been found.

Reproducement in nutshell:

  • new QLPreviewController conforming to UIViewControllerRepresentable
  • display the QLPreviewController in SwiftUI view

Thanks.

QLPreviewController with SwiftUI
 
 
Q