'Observe com.apple.configuration.managed only, and not all Defaults?

I need to observe any changes to the "com.apple.configuration.managed" plist on iOS.

To do that, I now do this:

NotificationCenter.default.addObserver(self, selector: #selector(........), name: UserDefaults.didChangeNotification, object: nil)

this works and I get notified when any defaults changes. So then when I get that notification I filter for the "com.apple.configuration.managed" key on the notification object and then react as needed.

Is there a way to only observe changes to the "com.apple.configuration.managed" plist and not the entire App Defaults?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source