domesticcatsoftware / DCRoundSwitch

A 'modern' replica of UISwitch.
MIT License
765 stars 162 forks source link

Creating DCRoundSwitch as a cell.accessoryView fires event multiple times for forControlEvents:UIControlEventValueChanged #3

Closed Critter closed 12 years ago

Critter commented 13 years ago

I swapped out a UISwitch and added DCRoundSwitch to the accessoryView of my cells. The toggle of the switch uses the incremented tag of each switch to keep track of which row the call came from. The target method is being executed multiple times per toggle of each switch...

rajeshtamda commented 11 years ago

I too faced the same issue. Solution to fix this issue is instead of setting its on property to yes or no call the method

[sender setOn:yes : animated:no ignoreControlEvents:YES]; (or) [sender setOn:yes : animated:no ignoreControlEvents:YES]; as per your requirment where sender is the object of DCRoundSwitch.