Latest 1.0.1
Homepage https://github.com/VladimirDinic/WDColorPicker
License MIT
Platforms ios 10.0
Authors

WDColorPicker is a simple lightweight component for displaying color picker inside iOS apps.

CocoaPods Compatible
License
Platform

Installation:

Manual

Download example project and add WDColorPickerView folder inside your project

CocoaPods:

target '<TargetName>' do
    use_frameworks!
    pod 'WDColorPicker', ' ~> 1.0.1'
end

Usage

Add color picker as interface component

GitHub Logo

  1. Add UIView in storyboard / xib file and subclass it with WDColorPickerView class from WDColorPicker module
  2. Implement WDColorPickerViewDelegate method func colorChanged(colorPicker: WDColorPickerView, color: UIColor) to handle color changes:
//Example of usage
import UIKit
import WDColorPicker    //If you are using CocoaPods

class InterfaceColorPickerViewController: UIViewController, WDColorPickerViewDelegate
{
    @IBOutlet weak var colorPicker: WDColorPickerView!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        self.colorPicker.delegate = self
    }

    func colorChanged(colorPicker: WDColorPickerView, color: UIColor) {
        self.view.backgroundColor = color
    }
}

Show color picker as pop up

GitHub Logo

  1. Implement WDColorPickerViewDelegate method func colorSelected(colorPicker: WDColorPickerView, color: UIColor) to handle color selection:
//Example of usage
import UIKit
import WDColorPicker    //If you are using CocoaPods

class PopUpColorPickerViewController: UIViewController, WDColorPickerViewDelegate
{

    @IBOutlet weak var colorButton: UIButton!
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    @IBAction func shwColorPicker(_ sender: Any) {
        WDColorPickerView.showPicker(delegate: self, initialColor: self.colorButton.backgroundColor)
    }

    func colorSelected(colorPicker: WDColorPickerView, color: UIColor) {
        self.colorButton.backgroundColor = color
    }
}

Note:

Documentation is still in preparation and the code will be updated regularly

If you find any bug, please report it, and I will try to fix it ASAP.

Latest podspec

{
    "name": "WDColorPicker",
    "platforms": {
        "ios": "10.0"
    },
    "version": "1.0.1",
    "summary": "WDColorPicker is a simple lightweight component for displaying color picker inside iOS apps.",
    "description": "This library enables you to include color picker very easy in your iOS app, and to use it in two basic modes: as interface component, or as a pop up.",
    "homepage": "https://github.com/VladimirDinic/WDColorPicker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Vladimir Dinic": "[email protected]"
    },
    "source": {
        "git": "https://github.com/VladimirDinic/WDColorPicker.git",
        "tag": "1.0.1"
    },
    "source_files": "WDColorPicker/WDColorPicker/WDColorPickerView/*",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This