Contents

writingIntent(with:options:)

Returns a file access intent object for writing to the given URL with the provided options.

Declaration

class func writingIntent(with url: URL, options: NSFileCoordinator.WritingOptions = []) -> Self

Parameters

  • url:

    The URL of the document you intend to write to.

  • options:

    The coordinated writing options. For a list of valid values, see Writingoptions in the Nsfilecoordinator.

Return Value

A newly instantiated and configured file access intent object.

Discussion

When calling a file coordinator’s coordinate(with:queue:byAccessor:) method, you pass an array of file access intent objects. Each intent object represents a specific read or write operation on a single document or directory. Use writingIntentWithURL:options: to create an intent object suitable for writing.

See Also

Related Documentation

Creating a File Access Intent