Instance Method


Generates the best possible thumbnail representation for a file and calls a handler upon completion.


func generateBestRepresentation(for request: QLThumbnailGenerator.Request, completion completionHandler: @escaping (QLThumbnailRepresentation?, Error?) -> Void)



The request that contains information about the thumbnail that you want to create.


The completion handler to call when the thumbnail generation completes. It is always called when QLThumbnailGenerator finishes the generation of a requested thumbnail.

The completion handler takes the following parameters:


The most representative version of the requested thumbnail or nil if QLThumbnailGenerator was unable to generate a thumbnail.


An error object that indicates why the thumbnail generation failed, or nil if the thumbnail generation succeeded.

See Also

Generating a Thumbnail

func generateRepresentations(for: QLThumbnailGenerator.Request, update: ((QLThumbnailRepresentation?, QLThumbnailRepresentation.RepresentationType, Error?) -> Void)?)

Generates various thumbnail representations for a file and calls the update handler for each thumbnail representation.

class QLThumbnailGenerator.Request

A request to generate a thumbnail for a file.