Type Method

canPreview(_:)

Indicates whether or not the Quick Look preview controller can display an item.

Declaration

iOS
class func canPreview(_ item: QLPreviewItem) -> Bool
Mac Catalyst
class func canPreviewItem(_ item: QLPreviewItem) -> Bool

Parameters

item

An item to be previewed.

Return Value

Returns true if the Quick Look preview controller can display the specified preview item.

Discussion

If an item cannot be displayed, but you still attempt to display it, a Quick Look preview controller displays a generic error. Always check if an item can be displayed before choosing whether or not to display it.

Refer to this document’s Overview section (QLPreviewController) for the types of items that a Quick Look preview controller can display.

See Also

Managing Item Previews

var currentPreviewItem: QLPreviewItem?

The item currently displayed in the Quick Look preview controller.

var currentPreviewItemIndex: Int

The index, within the preview item navigation list, of the item currently displayed in the Quick Look preview controller.

func refreshCurrentPreviewItem()

Asks the Quick Look preview controller to recompute the display of the current preview item.

func reloadData()

Asks the Preview Controller to reload its data from its data source.