ChromaColorPicker
ChromaColorPicker copied to clipboard
ChromaColorPicker and ChromaBrightnessSlider call events twice
The only event that you need to call is .valueChanged, UIControl subclasses call all other events on their own. So when you override endTracking, beginTracking and send event from there, you are sending the duplicate event.
I fixed this like this (is there other way?):
private var lastColorPickerColor = UIColor.clear
@objc func colorPickerTouchUpInside(_ sender: Any?)
{
if fullColorBrightness.currentColor.isEqual(lastColorPickerColor)
{
return
}
lastColorPickerColor = fullColorBrightness.currentColor
}