Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 634
Kelan Avatar asked Nov 14 '22 06:11

Kelan


1 Answers

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 UIBarButtonItems, you can set it on the toolbar's subviews (ick).

like image 110
tc. Avatar answered Jan 06 '23 13:01

tc.