---
title: "setUserInfoObject(_:forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/progress/setuserinfoobject(_:forkey:)"
---

# setUserInfoObject(_:forKey:)

Sets a value in the user info dictionary.

## Declaration

```swift
func setUserInfoObject(_ objectOrNil: Any?, forKey key: ProgressUserInfoKey)
```

## Parameters

- `objectOrNil`: The object to set for the specified key, or nil to remove an existing entry in the dictionary.
- `key`: The key for storing the specified object.

## Discussion

Discussion Use this method to set a value in the userInfo dictionary, with appropriate KVO notification for properties with values that can depend on values in the user info dictionary, like localizedDescription. Supply a value of nil to remove an existing dictionary entry for a specified key.

## See Also

### Inspecting Progress Information

- [kind](foundation/progress/kind.md)
- [estimatedTimeRemaining](foundation/progress/estimatedtimeremaining.md)
- [throughput](foundation/progress/throughput.md)
- [userInfo](foundation/progress/userinfo.md)
- [ProgressKind](foundation/progresskind.md)
- [ProgressUserInfoKey](foundation/progressuserinfokey.md)
