QLPreviewPanel
A class that implements the Quick Look preview panel to display a preview of a list of items.
Declaration
class QLPreviewPanelOverview
Every application has a single shared instance of QLPreviewPanel accessible through shared(). The preview panel follows the responder chain and adapts to the first responder willing to control it. A preview panel controller provides the content through methods defined in the QLPreviewPanelDataSource protocol.
You can’t subclass QLPreviewPanel; you can, however, customize its behavior using a delegate. See the QLPreviewPanelDelegate protocol for the methods to customize a preview panel’s behavior.
Take control of the preview panel
A preview panel has no controller until an object in the responder chain accepts control of it. The panel sends acceptsPreviewPanelControl(_:) to each object in the responder chain, and the first object to return true becomes the panel’s controller. Implement these methods in your window controller or delegate.
A controlling object also implements beginPreviewPanelControl(_:) and endPreviewPanelControl(_:). Set up the panel’s data source and delegate in beginPreviewPanelControl(_:), and tear them down in endPreviewPanelControl(_:). The panel sends all three messages itself, so never call them directly.
Topics
Accessing the Shared Panel
Accessing the Preview Panel Controller
Managing the Preview Items
dataSourcereloadData()refreshCurrentPreviewItem()currentPreviewItemIndexcurrentPreviewItemdisplayState