iOS: setting Exclusive Touch to all buttons in a view

后端 未结 8 522
灰色年华
灰色年华 2021-01-03 16:17

My app has many buttons in a Window and I want to set Exclusive Touch all of them together. Do you have any suggestion about this? Thanks

8条回答
  •  孤独总比滥情好
    2021-01-03 17:08

    If you want to set exclusiveTouch for ALL UIButtons in your whole application method swizzling will be the perfect solution for you.

    This answer explains the way very well : https://stackoverflow.com/a/24534814/976246 , and it works perfectly for me.

    Also go through this article to know how this (http://nshipster.com/method-swizzling/) tecknique can be used for various purposes.

提交回复
热议问题