EurekaCommunity / ColorPickerRow

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

By Mark Alldritt.

NEW

Added a new inline color picker row (InlineColorPickeRow) for version 1.2.

Introduction

ColorPickerRow is a Eureka custom row that allows you to choose colors. ColorRow lets you display a color in a row.

Demo

ColorPickerRow & InlineColorPickerRow Usage

import Eureka

class ViewController: FormViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        form
            +++ Section("Color Picker Demo")
                <<< ColorPickerRow("colors1") { (row) in
                    row.title = "Color Picker"
                    row.isCircular = false
                    row.showsCurrentSwatch = true
                    row.showsPaletteNames = true
                    row.value = UIColor.green
                }
                .onChange { (picker) in
                    print("color1: \(picker.value!)")
                }
    }
}

ColorRow Usage

import Eureka

class ViewController: FormViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        form
            +++ Section("Color Swatch Demo")
                <<< ColorRow("swatch1") { (row) in
                    row.title = "Chosen Color"
                    row.value = UIColor.green
                }
    }
}

Requirements

Getting involved

Before contribute check the CONTRIBUTING file for more info.

If you use ColorPickerRow in your app I would love to hear about it! Drop me a line on twitter.

Installation

  1. Add the following to your Podfile:
    pod 'ColorPickerRow'  
  1. Run $ pod install

ColorPickerRow Customization

                <<< ColorPickerRow("colors") { (row) in
                    row.title = "Color Picker"
                    row.isCircular = true
                    row.showsCurrentSwatch = false
                    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")])
                    cell.palettes = [palette]
                }

InlineColorPickerRow Customization

ColorRow Customization

Author

FAQ

nothing yet

Applications using ColorPickerRow

Other Rows

See my other contributions to the Eureka Community: