Eureka: How do I change the textColor for the textLabel in the LabelRow?

Created on 14 Oct 2015  路  2Comments  路  Source: xmartlabs/Eureka

I want to change the color of the text of a labelCell. I tried overriding the willDisplayCell function of the tableView, but it didn't work.

Most helpful comment

This works:

<<< LabelRow("total"){ $0.title = NSLocalizedString("Total", comment: "") $0.value = "0.0" }.cellUpdate({ cell, row in cell.detailTextLabel?.textColor = .redColor() })

All 2 comments

This works:

<<< LabelRow("total"){ $0.title = NSLocalizedString("Total", comment: "") $0.value = "0.0" }.cellUpdate({ cell, row in cell.detailTextLabel?.textColor = .redColor() })

You can also change it using the defaultCellUpdate class method:

        LabelRow.defaultCellUpdate = { cell, row in
            cell. detailTextLabel?.textColor = .redColor()
        }

Additional info of these functions: http://blog.xmartlabs.com/2015/09/29/Introducing-Eureka-iOS-form-library-written-in-pure-Swift/#fully-customizable

Was this page helpful?
0 / 5 - 0 ratings