<!--
{
  "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/deleteItem(identifier:baseVersion:options:request:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "File Provider"
    ],
    "preciseIdentifier" : "c:objc(pl)NSFileProviderReplicatedExtension(im)deleteItemWithIdentifier:baseVersion:options:request:completionHandler:"
  },
  "title" : "deleteItem(identifier:baseVersion:options:request:completionHandler:)"
}
-->

# deleteItem(identifier:baseVersion:options:request:completionHandler:)

Tells the file provider to delete an item forever.

```
func deleteItem(identifier: NSFileProviderItemIdentifier, baseVersion version: NSFileProviderItemVersion, options: NSFileProviderDeleteItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping ((any Error)?) -> Void) -> Progress
```

## Parameters

`identifier`

The identifier of the object to delete.

`version`

The version of the item to delete.

`options`

The options for deleting the item.

`request`

An object that identifies the context of that request, such as the requesting app.

`completionHandler`

A block that you call after deleting the item from your remote storage. You pass the following parameter:

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

## Return Value

An item that tracks your extension’s progress.

## Discussion

The system calls this method when the user deletes an item that was already in the trash. Users can only delete items that have the [`allowsDeleting`](/documentation/FileProvider/NSFileProviderItemCapabilities/allowsDeleting) capability.

Remove the item from the trash and delete it from your remote storage. If the item is in the working set, notify the system about the change by calling [`signalEnumerator(for:completionHandler:)`](/documentation/FileProvider/NSFileProviderManager/signalEnumerator(for:completionHandler:)) and passing [`workingSet`](/documentation/FileProvider/NSFileProviderItemIdentifier/workingSet) for the `containerItemIdentifier` parameter. If the deletion is recursive, be sure to check all the deleted items, and notify the system to any changes in the working set.

If your extension doesn’t recognize the item, you can just report success. The system then removes the local copy of the item.

---

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)