If you define UserDefaults that cover all the settings you have through System settings of the app and register defaults, that connects UserDefaults to Root.pList.
UserDefaults.standard.register(defaults: defaults)
Define a notification name
extension Notification.Name {
public static let kRefreshPrefs = Notification.Name("refreshPrefs")
}
Then, in AppDelegate, post notification when you enter foreground because you return from System Settings
func applicationWillEnterForeground(_ application: UIApplication) {
NotificationCenter.default.post(name: .kRefreshPrefs, object: self)
}
or do the same in SceneDelegate
func sceneWillEnterForeground(_ scene: UIScene) {
NotificationCenter.default.post(name: .kRefreshPrefs, object: self)
}
In ViewControllers when you need to know setting has changed, add an observer
NotificationCenter.default.addObserver(self, selector: #selector(refreshUserPrefs), name: .kRefreshPrefs, object: nil)
and do what you need to do in the selector