Instance Method


Exports the texture data to an image file at the specified URL, of the specified type.


func write(to nsurl: URL, type: CFString) -> Bool



The file URL at which to write the texture image.


A Uniform Type Identifier declaring the image file format to use for export.

Return Value

true if export succeeded; false otherwise.


For the type parameter, pass the Uniform Type Identifier for any output format supported by the Image I/O framework, such as the JPEG, TIFF, PNG, or (in macOS only) OpenEXR format. For details, see Uniform Type Identifiers Reference.

See Also

Exporting Textures

func write(to: URL) -> Bool

Exports the texture data to an image file at the specified URL.

func imageFromTexture() -> Unmanaged<CGImage>?

Exports the texture data as a CoreGraphics image.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software