---
title: "SCPreferencesSetCallback(_:_:_:)"
framework: systemconfiguration
role: symbol
role_heading: Function
path: "systemconfiguration/scpreferencessetcallback(_:_:_:)"
---

# SCPreferencesSetCallback(_:_:_:)

Assigns the specified callback to the specified preferences session.

## Declaration

```swift
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 doc://com.apple.systemconfiguration/documentation/SystemConfiguration/SCPreferencesContext for more information about this structure.

## Return Value

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

## Discussion

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

## See Also

### Managing Notifications and Callbacks

- [SCPreferencesScheduleWithRunLoop(_:_:_:)](systemconfiguration/scpreferencesschedulewithrunloop(_:_:_:).md)
- [SCPreferencesUnscheduleFromRunLoop(_:_:_:)](systemconfiguration/scpreferencesunschedulefromrunloop(_:_:_:).md)
- [SCPreferencesSetDispatchQueue(_:_:)](systemconfiguration/scpreferencessetdispatchqueue(_:_:).md)
