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):

  1. setting 1
  2. 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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

gradle error "Cannot convert the provided notation to a File or URI" -