---
title: "replace(action:with:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uimenubuilder/replace(action:with:)"
---

# replace(action:with:)

Replace an identified action with menu elements.

## Declaration

```swift
func replace(action replacedIdentifier: UIAction.Identifier, with replacementElements: [UIMenuElement])
```

## Parameters

- `replacedIdentifier`: The identifier of the action to be replaced.
- `replacementElements`: The replacement elements.
