Christian1313 / iOS_Swift_ColorPicker

iOS Color Picker written in Swift.
MIT License
40 stars 19 forks source link

iOS ColorPicker

Written completely in Swift.

ColorPicker ScreenShot

Overview

The Color Picker constist of a SwiftColorView and a SwiftColorPickerViewController. By Tapping or panning on the view the SwiftColorPickerDelegate is notfied about the changed color.

To customize the colors displayed by the SwiftColorPickerViewController implement the SwiftColorPickerDataSource protocoll and the caller class as the dataSource of the SwiftColorPickerViewController.

In the Repository are two Example projects, which show how to utilize the SwiftColorPickerViewController.

The SwiftColorViewis @IBDesignableso it will render nicely in InterfaceBuilder.

SwiftColorView in InterfaceBuilder

Usage

Copy the SwiftColorPickerViewController.swiftinto your project.

Add ViewController in a Storyboard

https://www.youtube.com/watch?v=VtV5bI_UBo4

You can change the porpertis of the SwiftColorViewin the inspector.

Add ViewController Programmatically

let colorPickerVC = SwiftColorPickerViewController()

colorPickerVC.delegate = self

colorPickerVC.dataSource = self

Parameters:

More

If you like the code write me.