swift - saving background color of tableview cell -


i did research little confused how solve problem. have tableview cells have button in it. when user clicks button background of cell changes. save background color when user starts app color selected. believe best way nsuserdefaults not 100% sure. if thats case set dictionary this? if can steer me in right direction appreciate it.

the first thing save color in data model, because otherwise colors become messed user scrolls , cells reused. cellforrowatindexpath: must rewritten assign correct background color every cell asked for.

the second thing think how color saved. example, if it's choice between 2 known colors, can save number. if color, of course need actual color value.

finally, yes, can save data model or part of in user defaults. color cannot saved in user defaults until archive nsdata (not hard).


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -