A very old question, but IMO deserves clarification.
Despite the fact that the Apple application has very misleading methodological documentation, the βAβ view with the exclusiveTouch setting will prevent other views from receiving events while A processes an event itself (for example, install the button with the exclusive Touch and place a finger on it, this will prevent the interaction of other views in the window, but interaction with them will follow the usual pattern after removing the finger from the exlusiveTouch element).
Another effect is to prevent the presentation of A events if any other presentation interacts (hold the button without the exclusive dialing pressed, and those with the exclusive Touch will also not be able to receive events).
You can still set the button in your view to an exclusive check and interact with others, just not at the same time, as this simple UIViewController test will prove (as soon as the correct bindings in IB are set for both Outlets and Actions)
#import "FTSViewController.h" @interface FTSViewController () - (IBAction)button1up:(id)sender; - (IBAction)button2up:(id)sender; - (IBAction)button1down:(id)sender; - (IBAction)button2down:(id)sender; @property (nonatomic, strong) IBOutlet UIButton *button1, *button2; @end @implementation FTSViewController - (IBAction)button1up:(id)sender { NSLog(@"Button1 up"); } - (IBAction)button2up:(id)sender { NSLog(@"Button2 up"); } - (IBAction)button1down:(id)sender { NSLog(@"Button1 down"); } - (IBAction)button2down:(id)sender { NSLog(@"Button2 down"); } - (void)viewDidLoad { [super viewDidLoad]; // Guarantees that button 1 will not receive events *unless* it the only receiver, as well as // preventing other views in the hierarchy from receiving touches *as long as button1 is receiving events* // IT DOESN'T PREVENT button2 from being pressed as long as no event is being intercepted by button1!!! self.button1.exclusiveTouch = YES; // This is the default. Set for clarity only self.button2.exclusiveTouch = NO; } @end
In light of this, the only good reason why IMHO for Apple does not set exclusiveTouch for YES for each subclass of UIView is that it would make the implementation of complex gestures real PITA, including probably some of the gestures that we are already used to in composite UIView subclasses (e.g. UIWebView), since setting selected views to exclusiveTouch = NO (e.g. a button) is faster than doing recursive exclusive Touch = YES, basically for everything to enable multitouch.
The disadvantage of this is that in many cases, the counter intuitive behavior of UIButtons and UITableViewCells (among others ...) can lead to strange errors and make testing more complicated (how did this happen to me, how ... 10 minutes ago? :( )
Hope this helps
Rick77
source share