---
title: "writingIntent(with:options:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsfileaccessintent/writingintent(with:options:)"
---

# writingIntent(with:options:)

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

## Declaration

```swift
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 doc://com.apple.foundation/documentation/Foundation/NSFileCoordinator/WritingOptions in the doc://com.apple.foundation/documentation/Foundation/NSFileCoordinator.

## Return Value

Return Value A newly instantiated and configured file access intent object.

## Discussion

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

- [coordinate(with:queue:byAccessor:)](foundation/nsfilecoordinator/coordinate(with:queue:byaccessor:).md)

### Creating a File Access Intent

- [readingIntent(with:options:)](foundation/nsfileaccessintent/readingintent(with:options:).md)
