Swift 3 Cocoa: use QuickLook to preview file in OS X
问题 Xcode 8.3.2 I don't find QLPreviewPanel in the command list and I don't know how to do (which command must be used) to display a file preview in a ViewController. 回答1: First of all you will need to add the import Quartz statement to your NSViewCOntroller . Second step is to add QLPreviewPanelDataSource, QLPreviewPanelDelegate to its declaration. Next you just need to get a reference of the shared QLPreviewPanel, make the view controller its dataSource and delegate and make its window key and