I\'m developing an iOS application with latest SDK.
I want to know when a property on NSUserDefaults
changes it value.
I have found this, but it
In Xcode help, the overview of UserDefaults
class (the swifty name for NSUserDefaults
) clearly states:
You can use key-value observing to register observers for specific keys of interest in order to be notified of all updates to a local defaults database. For more details, see Key-Value Observing Programming Guide."
I'll see if I can come up with a quick code-sample, but stack-overflow must be full of KVO samples in swift.