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

Continuos jumping state on-off #33

Open
dral3x opened this issue Mar 19, 2013 · 1 comment
Open

Continuos jumping state on-off #33

dral3x opened this issue Mar 19, 2013 · 1 comment

Comments

@dral3x
Copy link

dral3x commented Mar 19, 2013

In my app I prepare the switch state and observe the UIControlEventValueChanged event on it, to change some internal state.
The problem is that I receive the UIControlEventValueChanged event even if I set the state of the switch. With UISwitch object this doesn't happen.

The problem come from the last parameter on the setOn:animated: method in DCRoundSwitch class

- (void)setOn:(BOOL)newOn animated:(BOOL)animated
{
    [self setOn:newOn animated:animated ignoreControlEvents:NO];
}
@kamarshad
Copy link

I am facing the same issue as dral3x mentioned.
As i toggle the Switch, it's action method called continuously automatically.

After I have changed the method call and passing YES flag as following
[self setOn:newOn animated:animated ignoreControlEvents:YES];

Then it's action method does not call on toggling "On/Off".

Can anyone tell me what's wrong in the code and how can i fix this issue.

Thanks,
Kamarshad

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