---
title: "performAction(identifier:onItemsWithIdentifiers:completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileprovidercustomaction/performaction(identifier:onitemswithidentifiers:completionhandler:)"
---

# performAction(identifier:onItemsWithIdentifiers:completionHandler:)

Tells the File Provider extension to perform a custom action.

## Declaration

```swift
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:

## Return Value

Return Value An item that tracks your extension’s progress.

## Discussion

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 File Provider UI extension. For more information, see Adding Actions to the Context Menu.
