---
title: "setActionName(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/undomanager/setactionname(_:)-8lzip"
---

# setActionName(_:)

Sets the name of the action associated with the Undo or Redo command.

## Declaration

```swift
func setActionName(_ actionName: String)
```

## Parameters

- `actionName`: The name of the action.

## Discussion

Discussion If actionName is an empty string, the undo manager removes the action name currently associated with the menu command.

## See Also

### Managing the action name

- [undoActionName](foundation/undomanager/undoactionname.md)
- [redoActionName](foundation/undomanager/redoactionname.md)
- [setActionName(_:)](foundation/undomanager/setactionname(_:)-cci9.md)
