Creating DCRoundSwitch as a cell.accessoryView fires event multiple times for forControlEvents:UIControlEventValueChanged
Closed this issue · 1 comments
Critter commented
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
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.