Instance MethodFoundationEssentials
write(to:options:)
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
Writes the contents of the data buffer to a location.
func write(to url: URL, options: Data.WritingOptions = []) throws
Parameters
urlThe location to write the data into.
optionsOptions for writing the data. Default value is
[].
Discussion
Throws
An error in the Cocoa domain, if there is an error writing to the URL.