Writes asset data to a file at the specified URL and reports errors that occur during export.
SDKs
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Model I/O
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 path
property of the specified URL. To determine whether a format is supported for export, call the can
method.