---
title: "previewPanel(_:previewItemAt:)"
framework: quicklookui
role: symbol
role_heading: Instance Method
path: "quicklookui/qlpreviewpaneldatasource/previewpanel(_:previewitemat:)"
---

# previewPanel(_:previewItemAt:)

Returns the item that the preview panel should preview at a given index.

## Declaration

```swift
func previewPanel(_ panel: QLPreviewPanel!, previewItemAt index: Int) -> (any QLPreviewItem)!
```

## Parameters

- `panel`: The preview panel.
- `index`: The index of the item to preview.

## Return Value

Return Value The item that the preview panel should preview at index index.

## See Also

### Required Methods

- [numberOfPreviewItems(in:)](quicklookui/qlpreviewpaneldatasource/numberofpreviewitems(in:).md)
