Latest 0.2.0
Homepage https://github.com/Kautenja/BColorPicker
License MIT
Platforms ios 8.0
Dependencies PopupDialog
Frameworks UIKit
Authors

swift-version
travis-status
version
license
platform

Screenshots

The standard theme

standard

An example of custom theme utilizing tint color, background color, and fonts

themed

Features

  • [x] Themability
  • [x] User defined color lists for selection
  • [ ] Landscape support (all devices)

Installation

BColorPicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "BColorPicker"

Example

To run the example project, clone the repo, and run pod install from the
Example directory first. The example project can then be executed on a
simulator or a production device.

Code

To use a BColorPicker in your project it’s as easy as inserting this one line in
the view controller on which you want to display the popup:

let _ = BColorPicker.show(on: self, handledBy: nil)

This function returns an instance of BColorPicker in case you might want to
manipulate some of the controller manually.

let popup = BColorPicker.show(on: self, handledBy: nil)
popup.tintColor = #colorLiteral(red: 0.1568514521, 
                                green: 0.680490051, 
                                blue: 0.9768045545, 
                                alpha: 1)
popup.backgroundColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
popup.buttonFont = UIFont(name: "HelveticaNeue", size: 18.0)!
popup.colorList = [UIColor.gray, UIColor.blue, UIColor.yellow]

The reccomended way of handling color change is to implement a handler function
in the host view controller like this:

/// Handle a color selection from BColorPicker
func colorDidChange(to color: UIColor?) {

}

let _ = BColorPicker.show(on: self, handledBy: colorDidChange)

or like this using an escaping closure

let _ = BColorPicker.show(on: self) { color in
// handle color change with escaping closure
}

see ViewController for a production
example of how this might come together

License

BColorPicker is available under the MIT license. See the LICENSE file for more
info.

Latest podspec

{
    "name": "BColorPicker",
    "version": "0.2.0",
    "summary": "BColorPicker is a simple popup view for selecting colors from a table.",
    "description": "BColorPicker provides a simple framework for producing a popup from which to select colors.nIt's build upon the existing pod 'PopupDialog'",
    "homepage": "https://github.com/Kautenja/BColorPicker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kautenja": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Kautenja/BColorPicker.git",
        "tag": "0.2.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "BColorPicker/Classes/**/*",
    "resource_bundles": {
        "BColorPicker": [
            "BColorPicker/Assets/*"
        ]
    },
    "frameworks": "UIKit",
    "dependencies": {
        "PopupDialog": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This