previewController(_:previewItemAt:)
Returns the preview item that the controller displays for the specified index.
Declaration
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> any QLPreviewItemParameters
- controller:
The Quick Look preview controller that’s requesting a preview item.
- index:
The index position, within the preview navigation list, of the item to preview.
Return Value
The preview item to display. The item must be an NSURL object, or a custom object that conforms to the QLPreviewItem protocol.
Discussion
The system invokes this method when the preview controller needs the preview item for a specified index position.