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 -> QLThumbnailRepresentationParameters
- 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
QLThumbnailGeneratorfinishes the generation of a requested thumbnail.The completion handler takes the following parameters:
thumbnailThe most representative version of the requested thumbnail or
nilifQLThumbnailGeneratorwas unable to generate a thumbnail.errorAn error object that indicates why the thumbnail generation failed, or
nilif the thumbnail generation succeeded.