Instance Method

generateBestRepresentation(for:completion:)

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

Declaration

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

Parameters

request

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

completionHandler

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:

thumbnail

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

error

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.