Initializer

init(boundsSize:requestHandler:)

Creates a new image from existing artwork with the specified bounds.

Declaration

iOS, Mac Catalyst, tvOS, watchOS
init(boundsSize: CGSize, requestHandler: @escaping (CGSize) -> UIImage)
macOS
init(boundsSize: CGSize, requestHandler: @escaping (CGSize) -> NSImage)

Parameters

boundsSize

The original size of the artwork.

requestHandler

A handler called when artwork has been requested.

size

The new size for the image.

Return Value

The newly resized artwork.

Discussion

The request handler returns the an image in the newly requested size. The requested size must be less than the boundsSize parameter.