CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

SwiftColorPicker 0.0.5

SwiftColorPicker 0.0.5

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jun 2015
SPMSupports SPM

Maintained by Matthias Schlemm.




  • By
  • Matthias Schlemm

Swift Color Picker Screenshot

Installation

CocoaPod

Podfile:

use_frameworks!
pod 'SwiftColorPicker'

Usage

Simple Example

Create a Storyboard with 3 views and set the Classes to ColorWell (UIButton), ColorPicker (UIView) and HuePicker (UIView). Wire the Outlets with the following code:

import SwiftColorPicker

...

@IBOutlet var colorWell:ColorWell?
@IBOutlet var colorPicker:ColorPicker?
@IBOutlet var huePicker:HuePicker?

...
// Setup
pickerController = ColorPickerController(svPickerView: colorPicker!, huePickerView: huePicker!, colorWell: colorWell!)
pickerController?.color = UIColor.redColor()

// get color:
pickerController!.color

// get color updates:
pickerController?.onColorChange = {(color, finished) in
    if finished {
      self.view.backgroundColor = UIColor.whiteColor() // reset background color to white
    } else {
        self.view.backgroundColor = color // set background color to current selected color (finger is still down)
    }
}

Show case

https://itunes.apple.com/us/app/binary-clock-widget/id965640631

License

MIT-License