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

# QLPreviewReply

The class you create when providing a data-based Quick Look preview extension.

## Declaration

```swift
class QLPreviewReply
```

## Overview

Overview Create an instance of QLPreviewReply from the method providePreview(for:completionHandler:) in your subclass of QLPreviewProvider. Create an instance to return data, such as an image, PDF, or HTML, that the system displays as the preview for the content that QLFilePreviewRequest specifies.

## Topics

### Creating a preview reply

- [init(fileURL:)](quicklookui/qlpreviewreply/init(fileurl:).md)

### Creating a PDF preview reply

- [init(forPDFWithPageSize:createDocumentUsing:)](quicklookui/qlpreviewreply/init(forpdfwithpagesize:createdocumentusing:).md)

### Generating a preview reply

- [init(dataOfContentType:contentSize:createDataUsing:)](quicklookui/qlpreviewreply/init(dataofcontenttype:contentsize:createdatausing:).md)

### Drawing a preview reply

- [init(contextSize:isBitmap:drawUsing:)](quicklookui/qlpreviewreply/init(contextsize:isbitmap:drawusing:).md)

### Inspecting a preview reply

- [title](quicklookui/qlpreviewreply/title.md)
- [attachments](quicklookui/qlpreviewreply/attachments.md)
- [stringEncoding](quicklookui/qlpreviewreply/stringencoding-8ahm8.md)

## 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)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Data-based Preview Extensions

- [QLPreviewProvider](quicklookui/qlpreviewprovider.md)
- [QLFilePreviewRequest](quicklookui/qlfilepreviewrequest.md)
- [QLPreviewReplyAttachment](quicklookui/qlpreviewreplyattachment.md)
