Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the Tint Color of UITableView Multiple Selection Check Circles

When you enable allowsMultipleSelectionDuringEditing on a UITableView and then enter edit mode on it, each row will display a light grey circle on the left hand side. Upon tapping a row, the circle will be replaced with a tick icon, of the tint colour currently set to the table view.

Selected and Deselected check circles in UITableView

I'm wondering, is there any way to override the tint colours of both of these icons and control them manually? I've discovered if you set cell.tintColor, you can override the tint colour of the icon when it's checked (But not the hollow circle graphic), but I'd rather be able to change the tint colour of just this icon.

I'm getting the sinking feeling the only way to do this is to manually hack the internal subviews, but I'm hoping someone may have found a way I've missed.

like image 262
TiM Avatar asked Oct 29 '22 23:10

TiM


1 Answers

Setting the tintColor property of the cell should be enough.

e.g. cell.tintColor = .green

like image 177
snod Avatar answered Nov 15 '22 07:11

snod