This is a simple problem, but tricky to solve.
I have two buttons that perform the same function.
I've set different touch events for the buttons. Although this helps, it's still possible to press them simultaneously. On a slow connection, it will be even easier.
[vote1Btn addTarget:self action:@selector(voteUp:) forControlEvents:UIControlEventTouchUpInside];
[vote2Btn addTarget:self action:@selector(voteUp:) forControlEvents:UIControlEventTouchDown];
Set the exclusiveTouch
property of both buttons to YES.
If that isn't enough, have each button call the shared application object's beginIgnoringInteractionEvents
when its operation starts and call endIgnoringInteractionEvents
when its operation ends.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With