ChromaColorPicker icon indicating copy to clipboard operation
ChromaColorPicker copied to clipboard

ChromaColorPicker and ChromaBrightnessSlider call events twice

Open SwxllowAG opened this issue 5 years ago • 1 comments

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.

SwxllowAG avatar May 20 '20 15:05 SwxllowAG

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
    }

sabiland avatar Nov 07 '22 07:11 sabiland