ColorPicker
is a UI component for pick a color.
Swift5.6
iOS15
Adding Package Dependencies to Your App
import ColorPicker
...
let vc = ColorPickerViewController()
vc.setDelegate(self)
present(vc, animated: true)
let vc = ColorPickerViewController()
var configuration = ColorPickerConfiguration.default
configuration.initialColor = .red
configuration.initialColorItems = [.init(id: UUID(), color: .red)]
vc.configuration = configuration
vc.setDelegate(self)
present(vc, animated: true)
extension ContentViewController: ColorPickerViewControllerDelegate {
func colorPickerViewControllerDidFinish(_ viewController: ColorPickerViewController) {
print(#function, viewController.selectedColor)
}
func colorPickerViewController(_ viewController: ColorPickerViewController, didSelect color: UIColor, continuously: Bool) {
print(#function, color, continuously)
}
}
ColorPicker is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 19 |
Last commit: 1 year ago |
Full Changelog: https://github.com/henzai-apps/ColorPicker/compare/0.5.0...0.5.1
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics