Nilesh Agrawal Nilesh Agrawal - 7 months ago 70
iOS Question

Difference between sendEvent and Send Action in ios

I am trying to intercept the iOS UI events, I found that

can be used to do it.
I also tried to intercept UI events using

I wanted to know what the difference is between these two methods. Is the
more efficient?


may be this will help you


Sends an action message identified by selector to a specified target

- (BOOL)sendAction:(SEL)action
          forEvent:(UIEvent *)event

**action:**A selector identifying an action method. See the discussion for information on the permitted selector forms.

**target:**The object to receive the action message. If target is nil, the app sends the message to the first responder, from whence it progresses up the responder chain until it is handled.

**sender:**The object that is sending the action message. The default sender is the UIControl object that invokes this method.

**event:**A UIEvent object that encapsulates information about the event originating the action message.

- (void)sendEvent:(UIEvent *)event

Dispatches an event to the appropriate responder objects in the app.

**event:**A UIEvent object encapsulating the information about an event, including the touches involved.

look at this