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

# QLPreviewingController

A protocol for implementing a custom controller to create previews of files.

```
protocol QLPreviewingController : NSObjectProtocol
```

## Overview

A controller that implements the `QLPreviewingController` protocol must at least implement [`preparePreviewOfSearchableItem(identifier:queryString:completionHandler:)`](/documentation/QuickLookUI/QLPreviewingController/preparePreviewOfSearchableItem(identifier:queryString:completionHandler:)) or [`preparePreviewOfFile(at:completionHandler:)`](/documentation/QuickLookUI/QLPreviewingController/preparePreviewOfFile(at:completionHandler:)).

## Topics

### Instance Methods

[`func preparePreviewOfFile(at: URL, completionHandler: ((any Error)?) -> Void)`](/documentation/QuickLookUI/QLPreviewingController/preparePreviewOfFile(at:completionHandler:))

Prepares the preview of a file at the specified file’s URL.

[`func preparePreviewOfSearchableItem(identifier: String, queryString: String?, completionHandler: ((any Error)?) -> Void)`](/documentation/QuickLookUI/QLPreviewingController/preparePreviewOfSearchableItem(identifier:queryString:completionHandler:))

Prepares the preview for a file by using the data from Spotlight’s searchable item.

[`func providePreview(for: QLFilePreviewRequest, completionHandler: (QLPreviewReply?, (any Error)?) -> Void)`](/documentation/QuickLookUI/QLPreviewingController/providePreview(for:completionHandler:))

Prepares the preview of a file identified within a file preview request.

## Relationships

### Inherits From

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

---

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)