Protocol

QLPreviewControllerDataSource

The data source for a preview controller must adopt this protocol to provide preview items to the controller.

Declaration

protocol QLPreviewControllerDataSource

Overview

Besides providing a QLPreviewController with items to preview, this protocol is responsible for telling the preview controller how many items it needs to include in a preview item navigation list.

This protocol’s methods are required.

Topics

Providing Data to a Preview Controller

func numberOfPreviewItems(in: QLPreviewController) -> Int

Invoked when the Quick Look preview controller needs to know the number of preview items to include in the preview navigation list.

Required.

func previewController(QLPreviewController, previewItemAt: Int) -> QLPreviewItem

Invoked when the Quick Look preview controller needs the preview item for a specified index position.

Required.

See Also

Configuring a Preview Controller

var dataSource: QLPreviewControllerDataSource?

The preview controller’s data source.

var delegate: QLPreviewControllerDelegate?

The preview controller’s delegate object.

protocol QLPreviewControllerDelegate

The delegate of a preview controller must adopt this protocol.