Latest 0.4.0
Homepage https://github.com/akeome/ColorPickTip
License MIT
Platforms ios 9.3
Authors

CI Status
Version
License
Platform

Overview

  • Simple color-picker for iOS.
  • Picked color is detected in closure.
  • Customizable palette using UIColor.

Demo

oct-30-2018 21-16-30
oct-30-2018 21-18-10

Requirements

  • Xcode10
  • Swift 4.2
  • iOS 9.3 or higher

Installation

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

pod 'ColorPickTip'

Usage

ColorPickTip is based on UIPopoverPresentationController.
To show it, use present(_:animated:completion:) method.

let paletteColors: [[UIColor?]] = [[.red, .green, .blue], [.white, nil, .black]]

let colorPickTipVC = ColorPickTipController(palette: paletteColors, options: nil)
colorPickTipVC.popoverPresentationController?.delegate = colorPickTipVC
colorPickTipVC.popoverPresentationController?.sourceView = sender  // some UIButton
colorPickTipVC.popoverPresentationController?.sourceRect = sender.bounds

self.present(colorPickTipVC, animated: true, completion: nil)

Options

There are some options.

/// Theme color of PopupView. Default is light.
public var popoverViewTheme: PopoverViewTheme

/// Style for color palette. Default is round.
public var paletteStyle: PaletteStyle

/// Dismiss popover after picked. Default is true.
public var isDismissOnPick: Bool

/// ViewSize. Default is width:240 / height:150.
public var viewSize: CGSize

Author

Yuki [email protected]
Twitter

License

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

Latest podspec

{
    "name": "ColorPickTip",
    "version": "0.4.0",
    "summary": "A simple color picker view based on UIPopoverPresentationController.",
    "description": "Simple color-picker for iOS based on UIPopoverPresentationController.",
    "homepage": "https://github.com/akeome/ColorPickTip",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "akeome": "[email protected]"
    },
    "source": {
        "git": "https://github.com/akeome/ColorPickTip.git",
        "tag": "0.4.0"
    },
    "platforms": {
        "ios": "9.3"
    },
    "swift_version": "4.2",
    "source_files": "ColorPickTip/**/*.swift"
}

Pin It on Pinterest

Share This