ColorPickTip 0.4.0

ColorPickTip 0.4.0

Maintained by Yuki Yamashita.



  • By
  • akeome

ColorPickTip

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 Yamashita@akeome Twitter

License

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