Skip to content

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

url

The location to write the data into.

options

Options for writing the data. Default value is [].

Discussion

Throws

An error in the Cocoa domain, if there is an error writing to the URL.