<!--
{
  "availability" : [
    "macOS: 10.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLook",
  "identifier" : "/documentation/QuickLook/QLPreviewRequestIsCancelled(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Quick Look"
    ],
    "preciseIdentifier" : "c:@F@QLPreviewRequestIsCancelled"
  },
  "title" : "QLPreviewRequestIsCancelled(_:)"
}
-->

# QLPreviewRequestIsCancelled(_:)

Returns whether the preview request has been cancelled by the client.

```
func QLPreviewRequestIsCancelled(_ preview: QLPreviewRequest!) -> Bool
```

## Parameters

`preview`

The object representing the preview request.

## Return Value

`true` if the request is being canceled, `false` otherwise.

## Discussion

While computing the response, the generator can poll the preview request object with this function to determine if the client has cancelled the request. Alternatively, the generator can implement the `CancelPreviewGeneration` callback. but since that function is called in a secondary thread, it is generally safer to take the polling approach.

### Special Considerations

Thread-safety: This function should be called in the same thread as the preview request is made in; generally, this is the same thread in which the `GeneratePreviewForURL` callback was invoked.

---

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)