Deepak Sharma
Deepak Sharma

Reputation: 6585

UITableViewCell editing accessory color

I have a UITableView and have set multiple selection while editing to true

tableView.allowsMultipleSelectionDuringEditing = true

In the cell configuration (cellForRowAtIndexPath), I do:

            cell.selectionStyle = .default
            cell.accessoryType = .checkmark

So when tableView is set to editing mode, I get blue checkmark option on the left side. I want to change the default blue color on that accessory. How do I do that?

Upvotes: 1

Views: 1096

Answers (3)

Tung Vu Duc
Tung Vu Duc

Reputation: 1662

If you're using storyboard : Change the tint color here

enter image description here

Upvotes: 2

PGDev
PGDev

Reputation: 24341

In your custom UITableViewCell, set cell's tintColor in awakeFromNib() like so,

class CustomCell: UITableViewCell {
    override func awakeFromNib() {
        super.awakeFromNib()
        self.tintColor = .red
    }
}

Upvotes: 1

yankit Patel
yankit Patel

Reputation: 331

Just set the cell tint color whatever you want. It will automatically change the accessory type color.

[cell setTintColor:[UIColor whiteColor]];

Upvotes: 0

Related Questions