Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preventing multiple buttons from being touched at the same time

In iOS is there anyway to prevent a UIView containing multiple buttons (siblings) from being simultaneously from being touched? For instance, two non-overlapping buttons that are side by side can be tapped at the same time with two touches.

like image 597
happycodelucky Avatar asked Aug 13 '10 16:08

happycodelucky


2 Answers

Set UIView.exclusiveTouch.

like image 68
tc. Avatar answered Oct 01 '22 10:10

tc.


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

like image 38
Gajendra K Chauhan Avatar answered Oct 01 '22 10:10

Gajendra K Chauhan