开发者

Whats the best way to handle changes to settings (iPhone/iPad)?

开发者 https://www.devze.com 2023-04-12 12:14 出处:网络
I have just been implementing the InAppSettingsKit for my app and now I\'m trying to determine the best way to push out the new settings to my app. At present I have a couple of different view control

I have just been implementing the InAppSettingsKit for my app and now I'm trying to determine the best way to push out the new settings to my app. At present I have a couple of different view controllers that will be effected by setting changes. I understand that I will need to use a delegate method, however I would like some advice on how best to update other view controllers with new settings. Is there some sort of best pract开发者_JAVA百科ice that should be followed?


I believe that inAppSettingsKit uses NSUserDefaults, in which case the same practices apply.

General good practice for changed settings is to observe the notification NSUserDefaultsDidChangeNotification and update your views in the observer method. As many observers are usually required, delegate methods aren't a good solution for this problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号