EurekaCommunity / ColorPickerRow

A color picker row for use with the Eureka form library
MIT License
56 stars 15 forks source link

How to change titleLabel textColor ? #12

Closed skrew closed 5 years ago

skrew commented 5 years ago

Hi,

How to change this color ? (titled: "Color Picker 3")

screen shot 2018-11-10 at 00 01 21

Thanks

Update: Changing color in cellUpdate works with InlineColorPickerRow but not with ColorPickerRow

alldritt commented 5 years ago

The title is displayed using a UILabel. You can configure this label in .cellSetup:

                .cellSetup { (cell, row) in
                    cell.titleLabel.textColor = .blue
                    // ...
                }
skrew commented 5 years ago

Yes i have tested that, but i get 'titleLabel' is inaccessible due to 'internal' protection level error.

But even passing titleLabel public don't works, label is still black.

alldritt commented 5 years ago

I've pushed some changes to make the properties of the ColorPickerCell object public. Turns out, for InlineColorPickerRow, you need to alter the color in the update callback:

                        .cellUpdate { (cell, row) in
                            cell.textLabel?.textColor = .green
                        }

For ColorPickerRow you can use the .cellSetup or the .cellUpdate callbacks to alter the cell.titleLabel.textColor.