<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderManager/remove(_:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "File Provider"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileProviderManager(cm)removeDomain:completionHandler:"
  },
  "title" : "remove(_:completionHandler:)"
}
-->

# remove(_:completionHandler:)

Removes a domain from the File Provider extension.

```
class func remove(_ domain: NSFileProviderDomain, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`domain`

The domain to remove.

`completionHandler`

A block that the system calls after removing the domain. It 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
> class func remove(_ domain: NSFileProviderDomain) async throws
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

---

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)