Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Disable Multi Touch on UIBarButtonItems & UI Buttons?

My app has quite a few buttons on each screen as well as a UIBarButtonItem back button and I have problems with people being able to multi click buttons. I need only 1 button to be clickable at a time.

Does anyone know how to make a UIBarButtonItem back button exclusive to touch?

I've managed to disable multi clicking the UIButtons by setting each one's view to isExclusiveTouch = true but this doesn't seem to count for the back button in the navigation bar.

The back button doesn't seem to adhere to isExclusiveTouch.

Does anyone have a simple work around that doesn't involve coding each and every buttons send events?

Many Thanks,

Krivvenz.

like image 381
Krivvenz Avatar asked Nov 21 '16 11:11

Krivvenz


2 Answers

you can enable exclusive touch simply this will stop multiple touch until first touch is not done

buttton.exclusiveTouch = true
like image 106
Abhishek Avatar answered Nov 17 '22 13:11

Abhishek


You could write an extension for UIBarButtonItem to add isExclusiveTouch?

like image 1
AMAN77 Avatar answered Nov 17 '22 12:11

AMAN77