EurekaCommunity / ColorPickerRow

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

Can't use palettes with InlineColorPickerRow #16

Closed meoz closed 5 years ago

meoz commented 5 years ago

Works fine with ColorPickerRow but InlineColorPickerRow always shows the default palettes even when setting a custom palette like this:

        <<< InlineColorPickerRow("colorcode") { (row) in
            row.title = "Color Code"
            row.isCircular = true
            row.showsPaletteNames = false
            row.value = UIColor.white
            }
            .cellSetup { (cell, row) in
                let palette = ColorPalette(name: "All",
                                           palette: [ColorSpec(hex: "#ffffff", name: "White"),
                                                     ColorSpec(hex: "#000000", name: "Black")])
                row.inlineRow?.cell.palettes = [palette]
        }
alldritt commented 5 years ago

Use the palettes property of the InlineColorPickerRow instance instead:

            <<< InlineColorPickerRow("colorcode") { (row) in
                row.title = "Color Code"
                row.isCircular = true
                row.showsPaletteNames = false
                row.value = UIColor.white
                let palette = ColorPalette(name: "All",
                                           palette: [ColorSpec(hex: "#ffffff", name: "White"),
                                                     ColorSpec(hex: "#000000", name: "Black")])
                row.palettes = [palette]
            }
meoz commented 5 years ago

Thanks !!