generateCGImageAsynchronously(for:completionHandler:)
Generates an image asynchronously for a requested time, and returns the result in a callback.
Declaration
func generateCGImageAsynchronously(for requestedTime: CMTime, completionHandler handler: @escaping @Sendable (CGImage?, CMTime, (any Error)?) -> Void)Parameters
- requestedTime:
A time in the video timeline for which to generate an image. The requested time and actual time at which it generates an image may differ depending on the generator’s time tolerance settings.
- handler:
A callback that the image generator invokes with the result of the request.
Discussion
Swift clients should use the asynchronous image(at:) method instead.