---
title: QLPreviewProvider
framework: QuickLook UI
role: symbol
role_heading: Class
platforms: [macOS 12.0+]
path: quicklookui/qlpreviewprovider
---

# QLPreviewProvider

A class that you subclass to provide a data-based Quick Look preview extension.

## Declaration

```swift
class QLPreviewProvider
```

## Overview

Overview When you subclass QLPreviewProvider, conform your subclass to QLPreviewingController. To provide a data-based Quick Look extension, make the following modifications to your Info.plist file: Set the Boolean key QLIsDataBasedPreview to true. Add the type identifiers for your extension’s supported content types to the QLSupportedContentTypes array. Change the value of NSExtensionPrincipalClass to the name of your subclass. For example, if you named your subclass PreviewProvider, set the value to $(PRODUCT_MODULE_NAME).PreviewProvider. After updating the extension’s Info.plist file, implement the providePreview(for:completionHandler:) method to return a QLPreviewReply for the provided QLFilePreviewRequest.

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSExtensionRequestHandling](foundation/nsextensionrequesthandling.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Data-based Preview Extensions

- [QLFilePreviewRequest](quicklookui/qlfilepreviewrequest.md)
- [QLPreviewReply](quicklookui/qlpreviewreply.md)
- [QLPreviewReplyAttachment](quicklookui/qlpreviewreplyattachment.md)
