Contents

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  @Sendable (QLThumbnailRepresentation?, (any Error)?) -> Void)
func generateBestRepresentation(for request: QLThumbnailGenerator.Request) async throws -> QLThumbnailRepresentation

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.

Mentioned in

Discussion

See Also

Generating a Thumbnail