bcylin / QuickTableViewController

A simple way to create a UITableView for settings in Swift.

Home Page:https://bcylin.github.io/QuickTableViewController

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Customize TapActionRow button color

DSofter opened this issue · comments

How should I customize the button color of TapActionRow? I want to make the "logout" button red.

Thanks!

image

A custom cell type should come in handy.

let row = TapActionRow<CustomTapActionCell>(text: "Log out", action: { _ in })
import QuickTableViewController

final class CustomTapActionCell: TapActionCell {

  override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    tintColor = .red
  }

  required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
    tintColor = .red
  }

}

@bcylin Thank you so much for answering!