I have a UITableView that uses a variety of custom UITableViewCells.
I’d like to be able to have one of these table cells appear with a different separator color than the rest of the other cells.
I know that tableview.seperatorColor updates the whole tableView. Is there a cell specific property I missing or another approach to doing this?
Thanks for any tips. Sorry if I am just spacing on something in the UITableViewCell class.
Disclaimer – this worked for me at the time under my specific circumstances. It is not guaranteed to work, it appears to no longer work, and I now advise you subclass
UITableViewCell.Came across this post when looking to set the
UITableView.separatorColordifferently across groups/sections in a groupedUITableView.You don’t necessarily need to subclass
UITableViewCell. You can try settingtableView.separatorColoron each call totableView:cellForRowAtIndexPath:.For example, if you want the separator to be visible with the default color in the first section, visible in the first row/cell of the second section, and invisible in the rest of the rows in the second section, you can do the following: