How can I determine which UIControlEvents type caused a UIEvent?

后端 未结 1 1815
傲寒
傲寒 2021-01-11 10:51

What I want to do is set up a bunch of UIControl objects to send all events through the same handler. That handler than needs to determine what the appropriate

相关标签:
1条回答
  • 2021-01-11 11:32

    You're correct; UIEvent.type does not work that way. Internally, UIControl subclasses are basically using the sendActionsForControlEvents: method, which means they can choose to put anything they want as the parameter.

    As for how to know, the simple answer is to have a separate method for each control event.

    0 讨论(0)
提交回复
热议问题