Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

objective c how to set exclusive touch for all UIbuttons on the whole app

My app has many buttons through out the application

I want to set Exclusive Touch all of them together at one time. or all views in the app

we can set individually by

[button setExclusiveTouch:YES];

But i want to set at a time for all the buttons in the application

Can we set all view exclusive touch ?

any body have any idea please suggest me.

like image 522
iOS dev Avatar asked Nov 27 '22 09:11

iOS dev


1 Answers

The most elegant and actually the designed way to do this is by using the appearance proxy, which is designed to set a defined behaviour or appearance across the board for a given UI component.

[[UIButton appearance] setExclusiveTouch:YES];

For more information: Apple Documentation - UIAppearance and NSHipster - UIAppearance

like image 74
huahuahu Avatar answered Dec 09 '22 15:12

huahuahu