Allow touch on table cell to cancel other current touches
Is there a way to tell the system to cancel all touch event 开发者_如何转开发sequences that are currently happening in your app?
In one part of my app, I show a new view when a user selects a particular table cell. But, I want to make sure they aren't simultaneously touching any other buttons. For example, if they are holding a toolbar button while they select the table cell, I want to cancel that touch on the toolbar button.
A UIActionSheet
will do this type of touch-cancelling when it is shown, and that's exactly what I want to do.
I tried setting exclusiveTouch
on the UIToolbar
, but that didn't seem to help. And, the toolbar button is a UIBarButtonItem
, so it doesn't have an exclusiveTouch
property itself. Is there somewhere else I should set that property that might help?
Set exclusiveTouch
on the views that require exclusivity; this is probably the table cell instead of the buttons.
While you can't set exclusiveTouch
directly on UIBarButtonItem
s, you can set it on the toolbar's subviews (ick).
精彩评论