<!--
{
  "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/resumeSyncForUbiquitousItem(at:with:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileManager(im)resumeSyncForUbiquitousItemAtURL:withBehavior:completionHandler:"
  },
  "title" : "resumeSyncForUbiquitousItem(at:with:completionHandler:)"
}
-->

# resumeSyncForUbiquitousItem(at:with:completionHandler:)

Asynchronously resumes the sync on a paused item using the given resume behavior.

```
func resumeSyncForUbiquitousItem(at url: URL, with behavior: NSFileManagerResumeSyncBehavior, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`url`

The URL of the item for which to resume sync.

`behavior`

A [`NSFileManagerResumeSyncBehavior`](/documentation/Foundation/NSFileManagerResumeSyncBehavior) value that tells the file manager how to handle conflicts between local and remote versions of files.

`completionHandler`

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

## Discussion

Always call this method when your app closes an item to allow the file provider to sync local changes back to the server.

In most situations, the [`NSFileManagerResumeSyncBehavior.preserveLocalChanges`](/documentation/Foundation/NSFileManagerResumeSyncBehavior/preserveLocalChanges) behavior is the best choice to avoid any risk of data loss.

The resume call fails with [`featureUnsupported`](/documentation/Foundation/CocoaError/featureUnsupported) if `url` isn’t currently paused.
If the device isn’t connected to the network, the call may fail with [`NSFileWriteUnknownError`](/documentation/Foundation/NSFileWriteUnknownError-c.enum.case), with the underlying error of <doc://com.apple.documentation/documentation/FileProvider/NSFileProviderError/serverUnreachable>.

---

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)