Instance Method

export(to:)

Writes asset data to a file at the specified URL and reports errors that occur during export.

Declaration

func export(to URL: URL) throws

Parameters

URL

A URL specifying the location to export asset data to. This parameter must be a file: URL.

error

Upon return, an object describing any errors that occur during export.

Return Value

true if export succeeded; otherwise, false.

Discussion

The MDLAsset class infers the data format to export in from the pathExtension property of the specified URL. To determine whether a format is supported for export, call the canExportFileExtension(_:) method.

See Also

Exporting an Asset

class func canExportFileExtension(String) -> Bool

Returns a Boolean value that indicates whether the MDLAsset class can write asset data as a file with the specified format extension.

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