---
title: "SCPreferencesSetValue(_:_:_:)"
framework: systemconfiguration
role: symbol
role_heading: Function
path: "systemconfiguration/scpreferencessetvalue(_:_:_:)"
---

# SCPreferencesSetValue(_:_:_:)

Updates the data associated with the specified preference key with the specified value.

## Declaration

```swift
func SCPreferencesSetValue(_ prefs: SCPreferences, _ key: CFString, _ value: CFPropertyList) -> Bool
```

## Parameters

- `prefs`: The preferences session.
- `key`: The preference key.
- `value`: The value to associate with the preference key.

## Return Value

Return Value TRUE if the value was set; FALSE if an error occurred.

## Discussion

Discussion This function adds or replaces the value associated with the specified key. To commit these changes to permanent storage you must call SCPreferencesCommitChanges(_:).

## See Also

### Adding, Getting, and Removing Values

- [SCPreferencesAddValue(_:_:_:)](systemconfiguration/scpreferencesaddvalue(_:_:_:).md)
- [SCPreferencesGetValue(_:_:)](systemconfiguration/scpreferencesgetvalue(_:_:).md)
- [SCPreferencesRemoveValue(_:_:)](systemconfiguration/scpreferencesremovevalue(_:_:).md)
