<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderManager/reimportItems(below:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "File Provider",
      "FileProvider"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileProviderManager(im)reimportItemsBelowItemWithIdentifier:completionHandler:"
  },
  "title" : "reimportItems(below:completionHandler:)"
}
-->

# reimportItems(below:completionHandler:)

Tells the system to reimport the item and its content recursively.

```
func reimportItems(below itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`itemIdentifier`

The identifier of the item to reimport. The system reimports the item and all of its children.

`completionHandler`

A block called by the system immediately after receiving the request. The completion handler takes the following parameters:

- error: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.

## Discussion

> Important:
> You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> func reimportItems(below itemIdentifier: NSFileProviderItemIdentifier) async throws
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

This method tells the system that the specified item identifiers are no longer valid. Your file provider extension should call this method if it has lost track of its synchronization state and can’t guarantee the stability of the item identifiers anymore.

The system calls [`createItem(basedOn:fields:contents:options:request:completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/createItem(basedOn:fields:contents:options:request:completionHandler:)) and passes the [`mayAlreadyExist`](/documentation/FileProvider/NSFileProviderCreateItemOptions/mayAlreadyExist) option for each affected identifier in its working set. Your File Provider extension can then specify a new identifier for each item.

The system then calls [`importDidFinish(completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/importDidFinish(completionHandler:)) when the import is complete. If successful, the system always reimports the specified subtree, but it may reimport other items as well. If the item specified by the `itemIdentifier` parameter has no on-disk representation, the method fails with an [`NSFileProviderError.Code.noSuchItem`](/documentation/FileProvider/NSFileProviderError/Code/noSuchItem) error.

If your file provider loses synchronization but is still able to guarantee the stability of the identifiers, you don’t need to reimport the items. Instead, if the system queries the working set with an anchor that predates the synchronization loss, your File Provider extension can fail with an [`NSFileProviderError.Code.syncAnchorExpired`](/documentation/FileProvider/NSFileProviderError/Code/syncAnchorExpired) error.

If your file provider loses synchronization, but you aren’t interested in preserving the local data, you can resolve the issue by removing and then adding the domain back.

---

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)