<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLookThumbnailing",
  "identifier" : "/documentation/QuickLookThumbnailing/QLThumbnailProvider/provideThumbnail(for:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quick Look Thumbnailing"
    ],
    "preciseIdentifier" : "c:objc(cs)QLThumbnailProvider(im)provideThumbnailForFileRequest:completionHandler:"
  },
  "title" : "provideThumbnail(for:_:)"
}
-->

# provideThumbnail(for:_:)

Creates a thumbnail of a custom file type for a specific request.

```
func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, (any Error)?) -> Void)
```

## Parameters

`request`

The request that contains information about the thumbnail that you need to provide, such as the URL to the file.

`handler`

The completion handler to call when you finish creating a thumbnail. Call the completion handler with a [`QLThumbnailReply`](/documentation/QuickLookThumbnailing/QLThumbnailReply) if you can provide a thumbnail or with an <doc://com.apple.documentation/documentation/Foundation/NSError> if you can’t create a thumbnail.

    The platform doesn’t draw a thumbnail if you pass an     `error`     to the handler or the     `reply`     is     `nil.`

    You can call the handler asynchronously after the method has returned.

- `reply`: The object containing information about the  thumbnail image that the platform uses to draw the thumbnail.
- `error`: An error object that indicates why the thumbnail generation failed, or `nil` if the thumbnail generation succeeded.

## Discussion

To provide a thumbnail for a custom file type, subclass [`QLThumbnailProvider`](/documentation/QuickLookThumbnailing/QLThumbnailProvider), implement this method, and return a [`QLThumbnailReply`](/documentation/QuickLookThumbnailing/QLThumbnailReply) that either contains a drawing block or the URL to an image file.

---

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)