---
title: QLPreviewControllerDataSource
framework: quicklook
role: symbol
role_heading: Protocol
path: quicklook/qlpreviewcontrollerdatasource
---

# QLPreviewControllerDataSource

The protocol that a data source for a preview controller needs to adopt to provide preview items to the controller.

## Declaration

```swift
@MainActor protocol QLPreviewControllerDataSource
```

## Overview

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.

## Topics

### Providing data to a preview controller

- [numberOfPreviewItems(in:)](quicklook/qlpreviewcontrollerdatasource/numberofpreviewitems(in:).md)
- [previewController(_:previewItemAt:)](quicklook/qlpreviewcontrollerdatasource/previewcontroller(_:previewitemat:).md)

## See Also

### Configuring a preview controller

- [dataSource](quicklook/qlpreviewcontroller/datasource.md)
- [delegate](quicklook/qlpreviewcontroller/delegate.md)
- [QLPreviewControllerDelegate](quicklook/qlpreviewcontrollerdelegate.md)
