5

I am creating an IOS app using Swift 3 and implementing Eureka Forms. As part of a form I have a Button Row that is being used as a Delete button. I'm therefore looking to change the text colour to white.

I have tried the following, however cell text colour throws an error. Any thoughts on how I implement this correctly?

+++ Section("Delete Item")
  <<< ButtonRow() {
  $0.title = "Delete"
  }.cellSetup() {cell, row in
    cell.backgroundColor = UIColor.red
    cell.textLabel?.textColor = UIColor.whiteColor()
  }.onCellSelection {  cell, row in self.deleteItem() }
Michael Moulsdale
  • 1,488
  • 13
  • 34

1 Answers1

7

you are close, you must use tintColor instead of textColor, use this code

 <<< ButtonRow() {
      $0.title = "Delete"
      }.cellSetup() {cell, row in
          cell.backgroundColor = UIColor.red
          cell.tintColor = UIColor.white
      }

enter image description here

I hope this helps you

Reinier Melian
  • 20,519
  • 3
  • 38
  • 55