---
title: "importDidFinish(completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileproviderreplicatedextension/importdidfinish(completionhandler:)"
---

# importDidFinish(completionHandler:)

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

## Declaration

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

```swift
optional func importDidFinish() async
```

## Parameters

- `completionHandler`: A block that your implementation must call.

## Discussion

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: optional func importDidFinish() async For information about concurrency and asynchronous code in Swift, see 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:) or 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:) method and passes the 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:) method. Handle any necessary cleanup operations, and then call the completion handler.
