Changing color of single UITableView Cell in iOS Swift -
i want able change color of single uitableview cell. in tableview(editactionsforrowatindexpath) can swipe cell , select button change background color when scroll cell off screen changes back. how retain color? thanks
assuming have 1 section in tableview many rows, need in tableview:cellforrowatindexpath: method:
if (indexpath.row == coloredcellindex) { cell.backgroundcolor = uicolor.redcolor() } else { cell.backgroundcolor = uicolor.whitecolor() }
you need set variable coloredcellindex anywhere outside of function, example in viewdidload
Comments
Post a Comment