Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChromaColorPicker and ChromaBrightnessSlider call events twice #50

Open
SwxllowAG opened this issue May 20, 2020 · 1 comment
Open

ChromaColorPicker and ChromaBrightnessSlider call events twice #50

SwxllowAG opened this issue May 20, 2020 · 1 comment

Comments

@SwxllowAG
Copy link

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.

@sabiland
Copy link

sabiland commented Nov 7, 2022

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
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants