<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocument/canAsynchronouslyWrite(to:ofType:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocument(im)canAsynchronouslyWriteToURL:ofType:forSaveOperation:"
  },
  "title" : "canAsynchronouslyWrite(to:ofType:for:)"
}
-->

# canAsynchronouslyWrite(to:ofType:for:)

Returns whether the receiver can concurrently write to a file or file package located by a URL, that is formatted for a specific type, for a specific kind of save operation.

```
func canAsynchronouslyWrite(to url: URL, ofType typeName: String, for saveOperation: NSDocument.SaveOperationType) -> Bool
```

## Parameters

`url`

The location of the file or package to which the document is written.

`typeName`

The string that identifies the document type.

`saveOperation`

The type of save operation.

## Return Value

<doc://com.apple.documentation/documentation/Swift/false> by default; subclasses can override to return <doc://com.apple.documentation/documentation/Swift/true>, thereby enabling asynchronous writing.

## Discussion

The default implementation of this method returns <doc://com.apple.documentation/documentation/Swift/false>. You are strongly encouraged to override it and make it return <doc://com.apple.documentation/documentation/Swift/true>, after making sure your overrides of document writing methods can be safely invoked on a non-main thread, and making sure that the [`unblockUserInteraction()`](/documentation/AppKit/NSDocument/unblockUserInteraction()) method is invoked at some appropriate time during writing.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)