title: target-action uicontrolevents
body: <p>I must be missing something obvious here but  ...</p>
  
  <p>UIControl has a method</p>
  
  <pre><code>- (void)addTarget:(id)target action:(SEL)action forControlEvents: (UIControlEvents)controlEvents
  </code></pre>
  
  <p>which lets you add an action to be called when any of the given controlEvents occur. ControlEvents are a bitmask of events which tell you if a touch went down, or up inside, or was dragged etc., there's about 16 of them, you or them together and get called when any of them occur.</p>
  
  <p>The selector can have one of the following signatures</p>
  
  <pre><code>- (void)action
  - (void)action:(id)sender
  - (void)action:(id)sender forEvent:(UIEvent *)
  </code></pre>
  
  <p>none of those tell you what the control event bitmask was. The UIEvent is something slightly different, it's related to the actual touch event and doesn't (I think) contain the UIControlEvent. The sender (UIControl) doesn't have a way to find the control events either.</p>
  
  <p>I'd like to have one method which deals with a number of control events as I have some common code regardless of which event or events happened but I still need to know what the UIControlEvents were for some specific processing.</p>
  
  <p>Am I missing a way to find out what UIControlEvents were used when the action was called or do I really have to separate my code into</p>
  
  <pre><code>- (void)actionWithUIControlEventX;
  - (void)actionWithUIControlEventY;
  </code></pre>