Protocol

QLPreviewItem

A protocol that defines properties you implement to make your application’s content visible in a preview.

Declaration

@protocol QLPreviewItem

Overview

Implement the properties in this protocol to make your application’s content visible in a Quick Look preview. Use QLPreviewController to display a QuickLook preview on iOS, and QLPreviewPanel on macOS.

The methods in the QLPreviewItem protocol are also declared as a category on the NSURL class. As a result, you can use NSURL objects directly as preview items—provided that you want to use the default titles of those items. A default title is the last path component of an item’s URL. If you want to supply your own preview item titles, create your own preview item objects that adopt this protocol.

Topics

Providing the Preview Item URL

previewItemURL

The URL of the item to preview.

Required.

Providing Display Information for the Preview Item

previewItemTitle

The title to display for the preview item.

previewItemDisplayState

The display state for the preview item.

Relationships

Inherits From

Conforming Types

See Also

Previews and Thumbails

QLPreviewController

A specialized view controller for previewing an item.

QLPreviewingController

A protocol for implementing a custom controller to create previews of files.

Previews or Thumbnail Images for macOS 10.14 or Earlier

Create thumbnail images or previews of common files and custom file types on earlier versions of macOS.