---
title: "reconnect(completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileprovidermanager/reconnect(completionhandler:)"
---

# reconnect(completionHandler:)

Reconnects the domain with the extension.

## Declaration

```swift
func reconnect(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func reconnect() async throws
```

## Parameters

- `completionHandler`: A block that the system calls after reconnecting the domain. The block takes the following parameter:

## 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: func reconnect() async throws For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. Call this method to reconnect the domain after a call to the disconnect(reason:options:completionHandler:) method.

## See Also

### Working with domains

- [init(for:)](fileprovider/nsfileprovidermanager/init(for:).md)
- [import(_:fromDirectoryAt:completionHandler:)](fileprovider/nsfileprovidermanager/import(_:fromdirectoryat:completionhandler:).md)
- [add(_:completionHandler:)](fileprovider/nsfileprovidermanager/add(_:completionhandler:).md)
- [getDomainsWithCompletionHandler(_:)](fileprovider/nsfileprovidermanager/getdomainswithcompletionhandler(_:).md)
- [remove(_:completionHandler:)](fileprovider/nsfileprovidermanager/remove(_:completionhandler:).md)
- [remove(_:mode:completionHandler:)](fileprovider/nsfileprovidermanager/remove(_:mode:completionhandler:).md)
- [removeAllDomains(completionHandler:)](fileprovider/nsfileprovidermanager/removealldomains(completionhandler:).md)
- [NSFileProviderManager.DomainRemovalMode](fileprovider/nsfileprovidermanager/domainremovalmode.md)
- [disconnect(reason:options:completionHandler:)](fileprovider/nsfileprovidermanager/disconnect(reason:options:completionhandler:).md)
- [NSFileProviderManager.DisconnectionOptions](fileprovider/nsfileprovidermanager/disconnectionoptions.md)
- [waitForStabilization(completionHandler:)](fileprovider/nsfileprovidermanager/waitforstabilization(completionhandler:).md)
- [temporaryDirectoryURL()](fileprovider/nsfileprovidermanager/temporarydirectoryurl().md)
