Mac Developer Library

Developer

QLPreviewItem Protocol Reference for Mac

Options
Deployment Target:

On This Page
Language:

QLPreviewItem

The QLPreviewItem protocol declares the methods that the Quick Look preview panel (QLPreviewPanel) uses to access the contents of a given item.

Inheritance


Not Applicable

Import Statement


Swift

import Quartz

Objective-C

@import Quartz;

Availability


Available in OS X v10.6 and later.
  • previewItemURL previewItemURL Required Property

    The URL of the item to preview. (required)

    Declaration

    Swift

    var previewItemURL: NSURL! { get }

    Objective-C

    @property(readonly) NSURL *previewItemURL

    Discussion

    The URL must be a file URL.

    The accessor method should return nil if the item is not available for preview (the preview panel will display the “Loading” view).

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • The preview item's title. This property is optional.

    Declaration

    Swift

    optional var previewItemTitle: String! { get }

    Objective-C

    @property(readonly) NSString *previewItemTitle

    Discussion

    If set, this value used as the apparent item title instead of the default item display name.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • The display state for the preview item. This property is optional.

    Declaration

    Swift

    optional var previewItemDisplayState: AnyObject! { get }

    Objective-C

    @property(readonly) id previewItemDisplayState

    Discussion

    The display state is an opaque object used by the preview panel. You typically use the QLPreviewPanel method displayState to retrieve the display state which you save for later use in the preview item. This way you can preserve the display state when the panel moves from/to an other controller.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.6 and later.

    See Also

    displayState (QLPreviewPanel)