UIButton with multiple actions: How to prevent other actions from firing

后端 未结 3 1081
一向
一向 2021-01-14 08:15

I\'m trying to find a way to consume a button press, not from the response chain per se, but from other action methods bound to that button. I\'ve looked all over for this

3条回答
  •  再見小時候
    2021-01-14 08:45

    You may be able to add a category to UIButton (or subclass it), overriding the method sendActionsForControlEvents: to only call sendAction:to:forEvent: for one target (refer to the documentation on UIControl for descriptions of those methods).

提交回复
热议问题