Preventing multiple buttons from being touched at the same time
for(UIView* v in self.view.subviews)
{
if([v isKindOfClass:[UIButton class]])
{
UIButton* btn = (UIButton*)v;
[yourButton setExclusiveTouch:YES];
}
}
Swift 4 Syntax:
buttonA.isExclusiveTouch = true
buttonB.isExclusiveTouch = true
You can also use below method. If you have two buttons or more, to prevent multiple push at a time.
for e.g,
[Button1 setExclusiveTouch:YES];
[Button2 setExclusiveTouch:YES];
Set this method in your viewDidLoad
or viewWillAppear
Set UIView.exclusiveTouch.