---
title: "prepare(forAction:itemIdentifiers:)"
framework: fileproviderui
role: symbol
role_heading: Instance Method
path: "fileproviderui/fpuiactionextensionviewcontroller/prepare(foraction:itemidentifiers:)"
---

# prepare(forAction:itemIdentifiers:)

Performs any necessary setup or configuration for the specified action.

## Declaration

```swift
func prepare(forAction actionIdentifier: String, itemIdentifiers: [NSFileProviderItemIdentifier])
```

## Parameters

- `actionIdentifier`: The identifier for the action performed by the user.
- `itemIdentifiers`: The identifiers of the items affected by the action.

## Mentioned in

Adding Actions to the Context Menu

## Discussion

Discussion Use this method to prepare a user interface for handling the action. At a minimum, you should display feedback about the action. For more information, see Adding Actions to the Context Menu.

## See Also

### Working with Actions

- [prepare(forError:)](fileproviderui/fpuiactionextensionviewcontroller/prepare(forerror:).md)
- [extensionContext](fileproviderui/fpuiactionextensionviewcontroller/extensioncontext.md)
- [FPUIActionExtensionContext](fileproviderui/fpuiactionextensioncontext.md)
