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

# importDidFinish(completionHandler:)

Tells the File Provider extension that the system finished importing items.

```
optional func importDidFinish(completionHandler: @escaping @Sendable () -> Void)
```

## Parameters

`completionHandler`

A block that your implementation must call.

## 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
> optional func importDidFinish() async
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

The system calls this method after importing on-disk items. You can trigger an import by calling either [`reimportItems(below:completionHandler:)`](/documentation/FileProvider/NSFileProviderManager/reimportItems(below:completionHandler:)) or [`import(_:fromDirectoryAt:completionHandler:)`](/documentation/FileProvider/NSFileProviderManager/import(_:fromDirectoryAt:completionHandler:)). The system can also initiate its own imports as needed.

During the import, the system calls your File Provider extension’s [`createItem(basedOn:fields:contents:options:request:completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/createItem(basedOn:fields:contents:options:request:completionHandler:)) method and passes the [`mayAlreadyExist`](/documentation/FileProvider/NSFileProviderCreateItemOptions/mayAlreadyExist) option. Check to see if the item already exists in your remote storage—uploading it if necessary.

After importing all the items, the system calls your [`importDidFinish(completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/importDidFinish(completionHandler:)) method. Handle any necessary cleanup operations, and then call the completion handler.

---

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)