@fifafu Thanks for this solution. Added QuickLookUI and QuickLook as described. However, the app still crashes on this line of code:
QLPreviewPanel.shared().makeKeyAndOrderFront(self)
Note: this code lives in a local Swift package that is consumed by the main project. Not sure if that matters. Just to be sure I added import statements in the containing class for these two system frameworks. But that didn't help.
Do you think I am missing anything else?