<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLookUI",
  "identifier" : "/documentation/QuickLookUI/QLPreviewPanelDataSource",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Quick Look UI"
    ],
    "preciseIdentifier" : "c:objc(pl)QLPreviewPanelDataSource"
  },
  "title" : "QLPreviewPanelDataSource"
}
-->

# QLPreviewPanelDataSource

A protocol that the Quick Look preview panel uses to access the contents of its data source object.

```
protocol QLPreviewPanelDataSource
```

## Topics

### Required Methods

[`func numberOfPreviewItems(in: QLPreviewPanel!) -> Int`](/documentation/QuickLookUI/QLPreviewPanelDataSource/numberOfPreviewItems(in:))

Returns the number of items that the preview panel should preview.

[`func previewPanel(QLPreviewPanel!, previewItemAt: Int) -> (any QLPreviewItem)!`](/documentation/QuickLookUI/QLPreviewPanelDataSource/previewPanel(_:previewItemAt:))

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)