<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLook",
  "identifier" : "/documentation/QuickLook/QLPreviewController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Quick Look"
    ],
    "preciseIdentifier" : "c:objc(cs)QLPreviewController"
  },
  "title" : "QLPreviewController"
}
-->

# QLPreviewController

A specialized view controller for previewing an item.

```
class QLPreviewController
```

## Overview

A `QLPreviewController` can display previews for many common file types, including the following:

- iWork documents
- Microsoft Office documents
- Rich text format, or RTF, documents
- PDF files
- Images
- Text files with a uniform type identifier that conforms to the `public.text` type. To learn more, see <doc://com.apple.documentation/documentation/UniformTypeIdentifiers>.
- Comma-separated values, or CSV, files
- 3D models in the USDZ format with both standalone and AR views for viewing the model

> Note:
> The list of supported common file types may change between operating system releases. In addition, you can enable previews for your own file types by implementing your own preview extension.

### Providing data to a preview controller

To use a preview controller, you need to provide a data source object. The data source provides preview items to the controller and tells it how many items to include in a preview navigation list. If there’s more than one item in the list, a controller displays navigation arrows to let the user switch among the items. If you push a preview controller into view using a navigation controller, you can provide buttons in the navigation bar for moving through the navigation list.

For details on providing items to a preview controller, see [`QLPreviewControllerDataSource`](/documentation/QuickLook/QLPreviewControllerDataSource) and [`QLPreviewItem`](/documentation/QuickLook/QLPreviewItem).

### Presenting a preview controller

You can present a `QLPreviewController` modally by calling <doc://com.apple.documentation/documentation/UIKit/UIViewController/present(_:animated:completion:)> from a presenting <doc://com.apple.documentation/documentation/UIKit/UIViewController>, or you can push it into view using a <doc://com.apple.documentation/documentation/UIKit/UINavigationController>. The preview includes a title that the system derives from the last path component of the item URL. You can override it by implementing a [`previewItemTitle`](/documentation/QuickLook/QLPreviewItem/previewItemTitle) accessor for the preview item.

### Previewing items in Mac apps built with Mac Catalyst

For Mac apps built with Mac Catalyst, presenting a `QLPreviewController` displays the preview in a <doc://com.apple.documentation/documentation/QuickLookUI/QLPreviewPanel> and dims the previously active window. However, unlike on iOS devices, where displaying a preview hides the presenting view controller, the previously visible window’s content remains visible in Mac apps built with Mac Catalyst. Be sure the content is appropriate to display while the `QLPreviewPanel` is visible.

In addition, the system doesn’t display a live preview if you embed the `QLPreviewController` in another view controller. Instead, it displays a thumbnail that matches the size of the preview controller’s view.

## Topics

### Configuring a preview controller

[`dataSource`](/documentation/QuickLook/QLPreviewController/dataSource)

The preview controller’s data source.

[`QLPreviewControllerDataSource`](/documentation/QuickLook/QLPreviewControllerDataSource)

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

[`delegate`](/documentation/QuickLook/QLPreviewController/delegate)

The preview controller’s delegate object.

[`QLPreviewControllerDelegate`](/documentation/QuickLook/QLPreviewControllerDelegate)

The protocol that a delegate of a preview controller needs to adopt to handle Quick Look previews.

### Managing item previews

[`currentPreviewItem`](/documentation/QuickLook/QLPreviewController/currentPreviewItem)

The item displaying in the Quick Look preview controller.

[`currentPreviewItemIndex`](/documentation/QuickLook/QLPreviewController/currentPreviewItemIndex)

The index within the preview item navigation list of the item displaying in the Quick Look preview controller.

[`refreshCurrentPreviewItem()`](/documentation/QuickLook/QLPreviewController/refreshCurrentPreviewItem())

Asks the Quick Look preview controller to recompute the display of the current preview item.

[`reloadData()`](/documentation/QuickLook/QLPreviewController/reloadData())

Asks the preview controller to reload its data from its data source.



---

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)
