Contents

init(image:quality:)

Creates an attachment containing a representation of the provided image at the requested image quality.

Declaration

convenience init(image: UIImage, quality: XCTAttachment.ImageQuality)
convenience init(image: NSImage, quality: XCTAttachment.ImageQuality)

Parameters

  • image:

    The image to wrap as an attachment.

  • quality:

    The quality setting to use when storing the image in the attachment.

Discussion

Creates an attachment with a uniformTypeIdentifier of "public.png" when quality is XCTAttachment.ImageQuality.original, and a uniformTypeIdentifier of "public.jpeg" when quality is XCTAttachment.ImageQuality.medium or XCTAttachment.ImageQuality.low.

See Also

Creating Attachments from Images and Screenshots