<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocument/performAsynchronousFileAccess(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDocument(im)performAsynchronousFileAccessUsingBlock:"
  },
  "title" : "performAsynchronousFileAccess(_:)"
}
-->

# performAsynchronousFileAccess(_:)

Schedules a document-reading or document-writing operation on a concurrent background queue.

```
func performAsynchronousFileAccess(_ block: @escaping () -> Void)
```

## Parameters

`block`

A block that’s invoked as the task to execute on the background queue. The block returns no value and takes no parameters.

## Discussion

A typical [`UIDocument`](/documentation/UIKit/UIDocument) subclass — one that overrides [`contents(forType:)`](/documentation/UIKit/UIDocument/contents(forType:)) and [`load(fromContents:ofType:)`](/documentation/UIKit/UIDocument/load(fromContents:ofType:)) — doesn’t need to call this method.

The default implementations of [`save(to:for:completionHandler:)`](/documentation/UIKit/UIDocument/save(to:for:completionHandler:)) and [`open(completionHandler:)`](/documentation/UIKit/UIDocument/open(completionHandler:)) call this method to serialize file access. If you override these methods and don’t call `super`, you should call this method to serialize file access on a background queue. If you directly call the [`read(from:)`](/documentation/UIKit/UIDocument/read(from:)) method, you should wrap that call in the block passed into [`performAsynchronousFileAccess(_:)`](/documentation/UIKit/UIDocument/performAsynchronousFileAccess(_:)).

---

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)