---
title: "QLPreviewRequestIsCancelled(_:)"
framework: quicklook
role: symbol
role_heading: Function
path: "quicklook/qlpreviewrequestiscancelled(_:)"
---

# QLPreviewRequestIsCancelled(_:)

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

## Declaration

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

## Parameters

- `preview`: The object representing the preview request.

## Return Value

Return Value true if the request is being canceled, false otherwise.

## Discussion

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.

## See Also

### Requesting previews

- [QLPreviewRequestCopyContentUTI(_:)](quicklook/qlpreviewrequestcopycontentuti(_:).md)
- [QLPreviewRequestCopyOptions(_:)](quicklook/qlpreviewrequestcopyoptions(_:).md)
- [QLPreviewRequestCopyURL(_:)](quicklook/qlpreviewrequestcopyurl(_:).md)
- [QLPreviewRequestCreateContext(_:_:_:_:)](quicklook/qlpreviewrequestcreatecontext(_:_:_:_:).md)
- [QLPreviewRequestCreatePDFContext(_:_:_:_:)](quicklook/qlpreviewrequestcreatepdfcontext(_:_:_:_:).md)
- [QLPreviewRequestFlushContext(_:_:)](quicklook/qlpreviewrequestflushcontext(_:_:).md)
- [QLPreviewRequestGetDocumentObject(_:)](quicklook/qlpreviewrequestgetdocumentobject(_:).md)
- [QLPreviewRequestSetDocumentObject(_:_:_:)](quicklook/qlpreviewrequestsetdocumentobject(_:_:_:).md)
- [QLPreviewRequestGetGeneratorBundle(_:)](quicklook/qlpreviewrequestgetgeneratorbundle(_:).md)
- [QLPreviewRequestGetTypeID()](quicklook/qlpreviewrequestgettypeid().md)
- [QLPreviewRequestSetDataRepresentation(_:_:_:_:)](quicklook/qlpreviewrequestsetdatarepresentation(_:_:_:_:).md)
- [QLPreviewRequestSetURLRepresentation(_:_:_:_:)](quicklook/qlpreviewrequestseturlrepresentation(_:_:_:_:).md)
