davdroman / Bohr

Settings screen composing framework
MIT License
1.26k stars 83 forks source link

ValueDidChange in BOSetting #34

Closed gmoledina closed 8 years ago

gmoledina commented 8 years ago

The setValueDidChangeBlock method in BOSetting is not exposed in the header file. I'm wondering how the Model layer can register to be notified for any changes (so without adding itself as a target in the UI layer) ?

davdroman commented 8 years ago

This again comes down to the discussion in #32. As Bohr relies uniquely on NSUserDefaults, value observation can be achieved simply by observing NSUserDefaults directly through the standard KVO mechanism. Again, I didn't originally include support for observation because of the reliance on NSUserDefaults, but this is something we definitely need to work on for the next major, storage-agnostic release.

gmoledina commented 8 years ago

Oh perfect, thanks for the answer. :+1: