---
title: UndoManager.UserInfoKey
framework: foundation
role: symbol
role_heading: Structure
path: foundation/undomanager/userinfokey
---

# UndoManager.UserInfoKey

An extensible namespace for undo and redo user info keys.

## Declaration

```swift
struct UserInfoKey
```

## Discussion

Discussion Extend this type with the names of user info keys you want to associate with undo actions, like this: extension UndoManager.UserInfoKey {     static let icon: UndoManager.UserInfoKey = "icon" } You then use this key when you set and get undo user info values. self.undoManager.setActionUserInfoValue(Image(named: "new_layer"), forKey: .icon)

## Topics

### Creating a user info key from a raw value

- [init(_:)](foundation/undomanager/userinfokey/init(_:).md)
- [init(rawValue:)](foundation/undomanager/userinfokey/init(rawvalue:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Working with user info

- [setActionUserInfoValue(_:forKey:)](foundation/undomanager/setactionuserinfovalue(_:forkey:).md)
- [undoActionUserInfoValue(forKey:)](foundation/undomanager/undoactionuserinfovalue(forkey:).md)
- [redoActionUserInfoValue(forKey:)](foundation/undomanager/redoactionuserinfovalue(forkey:).md)
