ios - How to set table cell checkmark based on a user default setting -
i have simple table has 2 cells checkmark options (these meant settings options):
- setting 1
- setting 2
in storyboard have prototype cells' accessory set checkmark. of course automatically checks both of cells when they're built.
what can't figure out how check user default settings upon viewdidload
, determine of cells should checked. these particular settings set in nsuserdefaults
setting 1 = true
, setting 2 = false
. out of box settings.
i know it's got if statement of sort. maybe this:
if settingscell[0] && settingday == true{ settingscell.accessorytype = .checkmark }
but can't figure out:
a) proper syntax
b) should placed in uiviewcontroller (viewdidload stated earlier or in tableview function) checkmark cells based on actual settings?
any appreciated!
Comments
Post a Comment