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

# QLPreviewProvider

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

```
class QLPreviewProvider
```

## Overview

When you subclass [`QLPreviewProvider`](/documentation/QuickLookUI/QLPreviewProvider), conform your subclass [`QLPreviewingController`](/documentation/QuickLookUI/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:)`](/documentation/QuickLookUI/QLPreviewingController/providePreview(for:completionHandler:)) method to return a [`QLPreviewReply`](/documentation/QuickLookUI/QLPreviewReply) for the provided [`QLFilePreviewRequest`](/documentation/QuickLookUI/QLFilePreviewRequest).

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`NSExtensionRequestHandling`](/documentation/Foundation/NSExtensionRequestHandling)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)