Protocol: QLPreviewControllerDataSource

Overview

The data source for a QLPreviewController (Quick Look preview controller) object must adopt this protocol to enable it to provide preview items to the controller.Invoked when the Quick Look preview controller needs to know the number of preview items to include in the preview navigation list. (required)Invoked when the Quick Look preview controller needs the preview item for a specified index position. (required)

Instance Method Summary (collapse)

Instance Method Details

- (Integer) numberOfPreviewItemsInPreviewController(controller)

Invoked when the Quick Look preview controller needs to know the number of preview items to include in the preview navigation list. (required) If you push a Quick Look preview controller into view using a UINavigationController object that has a toolbar, the system automatically displays arrows in the toolbar to navigate among the items in the navigation list. If you are not displaying a toolbar and want to provide your own method of switching among items, use the currentPreviewItemIndex property to indicate the item you want to display.If you display a preview controller modally (full screen), the controller includes navigation arrows if there is more than one item in the navigation list.

Parameters:

  • controller (QLPreviewController)

    The Quick Look preview controller that is requesting the number of preview items.

Returns:

  • (Integer)

    The number of items that the Quick Look preview controller should include in its preview navigation list.

- (Object) previewController(controller, previewItemAtIndex, index)

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

Parameters:

  • controller (QLPreviewController)

    The Quick Look preview controller that is requesting a preview item.

  • index (Integer)

    The index position, within the preview navigation list, of the item to preview.

Returns:

  • (Object)

    The preview item to display. The item must be an NSURL object, or a custom object that conforms to the QLPreviewItem protocol.