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

# performAction(identifier:onItemsWithIdentifiers:completionHandler:)

Tells the File Provider extension to perform a custom action.

```
func performAction(identifier actionIdentifier: NSFileProviderExtensionActionIdentifier, onItemsWithIdentifiers itemIdentifiers: [NSFileProviderItemIdentifier], completionHandler: @escaping ((any Error)?) -> Void) -> Progress
```

## Parameters

`actionIdentifier`

The identifier for the requested custom action from the extension’s `Info.plist` file.

`itemIdentifiers`

A list of item identifiers affected by the action.

`completionHandler`

A block that you call after completing the specified action. You pass the following parameters:

- 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

Define the custom actions in the File Provider Extension’s `Info.plist` file, under the `NSExtensionFileProviderActions` key. The format of this key is identical to actions defined for a <doc://com.apple.documentation/documentation/FileProviderUI> extension. For more information, see `Adding Actions to the Context Menu`.

---

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)