A message the system sends when a user-defaults setting changes.
When you write a new value to a setting, or remove an existing value, the system generates this message to alert you that your app’s settings changed.
Use this message in other parts of your app to incorporate updated settings.
The system posts this notification on the same thread you used to make the change.
If a different process changes your app’s settings, the system doesn’t generate this notification.
To detect changes made by another process, register a key-value observer on the ``UserDefaults`` object.
Key-value observing reports all updates to setting values, regardless of which process made the change.
Observe this message with the identifier ``NotificationCenter/MessageIdentifier/didChange-187tw``, or specify its type directly to the `addObserver(of:for:using:)` method.
The ``NotificationCenter/MainActorMessage/Subject`` of this message type is ``UserDefaults``.
This message interoperates with the notification ``UserDefaults/didChangeNotification``.
The system notifies observers of the message when the ``NotificationCenter`` posts the notification.
Similarly, the system notifies observers of the notification when it posts the message.
Converts a posted notification into this asynchronous message type for any observers.
To implement this method in your own `AsyncMessage` conformance, retrieve values from the ``Notification``'s ``Notification/userInfo`` and set them as properties on the message.
- Parameter notification: The posted ``Notification``.
- Returns: The converted `AsyncMessage`, or `nil` if conversion is not possible.
get · iOS 26.0+
name
TypeScript
static get nameValue(): NSNotification_Name
Swift declaration
static var name: Notification.Name { get }
A optional name corresponding to this type, used to interoperate with notification posters and observers.
init · iOS 26.0+
init
TypeScript
static init(): UserDefaults_DidChangeMessage
Swift declaration
init()
Creates a message for a settings change to the user defaults.