Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift 3 Eureka Forms change button row font color

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() }
like image 926
Michael Moulsdale Avatar asked Mar 13 '17 21:03

Michael Moulsdale


1 Answers

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

like image 132
Reinier Melian Avatar answered Oct 06 '22 08:10

Reinier Melian