Posted when user defaults are changed within the current process.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
class let didChangeNotification: NSNotification.Name
Discussion
This notification is posted on the thread that changes the user defaults. The notification object is the User object. The notification doesn't contain a user dictionary.
This notification isn't posted when changes are made outside the current process, or when ubiquitous defaults change. You can use key-value observing to register observers for specific keys of interest in order to be notified of all updates, regardless of whether changes are made within or outside the current process.