Find a solution:
userDefaults.addObserver(self, forKeyPath: "youKey", options: .new, context: nil)
And:
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
//do something
}
Topic:
App & System Services
SubTopic:
General
Tags: