davdroman / Bohr

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

Can't set UISwitch on property #28

Closed irosenb closed 8 years ago

irosenb commented 8 years ago

When I try to add a BOSwitchTableViewCell and set the on property in the handler to true, it doesn't work.

davdroman commented 8 years ago

Hey @irosenb:

The idea behind Bohr is to be able to offer a visual input/output mechanism to complement NSUserDefaults, input coming from the user, output coming from NSUserDefaults itself. As mentioned previously in #26:

You should never need to explicitly worry about your BOTableViewCell's values. The idea of Bohr is to have them set up automatically depending on a certain NSUserDefaults value. So what you actually want to do is set some value for some NSUserDefaults key and then associate that key to whatever cell you're displaying on your BOTableViewController. As long as the type of the default is appropriate for the cell you're using, everything (from setting to displaying that default) will be taken care of for you automatically by Bohr.