QLPreviewRequestIsCancelled(_:)
Returns whether the preview request has been cancelled by the client.
Declaration
func QLPreviewRequestIsCancelled(_ preview: QLPreviewRequest!) -> BoolParameters
- 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.
See Also
Requesting previews
QLPreviewRequestCopyContentUTI(_:)QLPreviewRequestCopyOptions(_:)QLPreviewRequestCopyURL(_:)QLPreviewRequestCreateContext(_:_:_:_:)QLPreviewRequestCreatePDFContext(_:_:_:_:)QLPreviewRequestFlushContext(_:_:)QLPreviewRequestGetDocumentObject(_:)QLPreviewRequestSetDocumentObject(_:_:_:)QLPreviewRequestGetGeneratorBundle(_:)QLPreviewRequestGetTypeID()QLPreviewRequestSetDataRepresentation(_:_:_:_:)QLPreviewRequestSetURLRepresentation(_:_:_:_:)