<!--
{
  "availability" : [
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SystemConfiguration",
  "identifier" : "/documentation/SystemConfiguration/SCPreferencesSetCallback(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "System Configuration"
    ],
    "preciseIdentifier" : "c:@F@SCPreferencesSetCallback"
  },
  "title" : "SCPreferencesSetCallback(_:_:_:)"
}
-->

# SCPreferencesSetCallback(_:_:_:)

Assigns the specified callback to the specified preferences session.

```
func SCPreferencesSetCallback(_ prefs: SCPreferences, _ callout: SCPreferencesCallBack?, _ context: UnsafeMutablePointer<SCPreferencesContext>?) -> Bool
```

## Parameters

`prefs`

The preferences session.

`callout`

The function to be called when the preferences have been changed or applied. If `NULL`, the current callback is removed.

`context`

The context associated with the callback function. See [`SCPreferencesContext`](/documentation/SystemConfiguration/SCPreferencesContext) for more information about this structure.

## Return Value

`TRUE` if the callback was successfully associated with the preferences session; otherwise, `FALSE`.

## Discussion

This function is called when the changes to the preferences have been committed or applied.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)