fetchUIImage(completion:)
Fetches the image and provides it to the specified completion handler.
Declaration
func fetchUIImage(completion: @escaping @Sendable (UIImage?) -> Void)func fetchUIImage() async -> UIImage?Parameters
- completion:
The completion handler that executes when the image is available. The handler has no return value and takes the following parameter:
imageA Uiimage that contains the image data. If there’s an error, this parameter is
nil.
Discussion
Use this method to fetch an instance of UIImage that contains the corresponding image data. Provide a completion handler; otherwise, calling this method does nothing. The handler executes on the same thread that invokes the method.