<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FileManager/pauseSyncForUbiquitousItem(at:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileManager(im)pauseSyncForUbiquitousItemAtURL:completionHandler:"
  },
  "title" : "pauseSyncForUbiquitousItem(at:completionHandler:)"
}
-->

# pauseSyncForUbiquitousItem(at:completionHandler:)

Asynchronously pauses sync of an item at the given URL.

```
func pauseSyncForUbiquitousItem(at url: URL, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`url`

The URL of the item for which to pause sync.

`completionHandler`

A closure or block that the framework calls when the pause action completes. It receives a single [`NSError`](/documentation/Foundation/NSError) parameter to indicate an error that prevented pausing; this value is `nil` if the pause succeeded. In Swift, you can omit the completion handler and catch the thrown error instead.

## Discussion

Call this when opening an item to prevent sync from altering the contents of the URL.
Once paused, the file provider will not upload local changes nor download remote changes.

While paused, call [`uploadLocalVersionOfUbiquitousItem(at:withConflictResolutionPolicy:completionHandler:)`](/documentation/Foundation/FileManager/uploadLocalVersionOfUbiquitousItem(at:withConflictResolutionPolicy:completionHandler:)) when the document is in a stable state.
This action keeps the server version as up-to-date as possible.

If the item is already paused, a second call to this method reports success.
If the file provider is already applying changes to the item, the pause fails with an [`NSFileWriteUnknownError`](/documentation/Foundation/NSFileWriteUnknownError-c.enum.case), with an underlying error that has domain [`NSPOSIXErrorDomain`](/documentation/Foundation/NSPOSIXErrorDomain) and code [`EBUSY`](/documentation/Foundation/POSIXError/EBUSY).
If the pause fails, wait for the state to stabilize before retrying.
Pausing also fails with [`featureUnsupported`](/documentation/Foundation/CocoaError/featureUnsupported) if `url` refers to a regular (non-package) directory.

Pausing sync is independent of the calling app’s lifecycle; sync doesn’t automatically resume if the app closes or crashes and relaunches later.
To resume syncing, explicitly call [`resumeSyncForUbiquitousItem(at:with:completionHandler:)`](/documentation/Foundation/FileManager/resumeSyncForUbiquitousItem(at:with:completionHandler:)).
Always be sure to resume syncing before you close the item.

---

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)