Responder chain hittest: withEvent: Method usage, hittestwithevent
Http://www.cnblogs.com/wendingding/p/3795171.html for the basic content of the responder chain
Here I want to explain how to use-(UIView *) hitTest :( CGPoint) point withEvent :( UIEvent *) event;
The Response Process in the responder chain is as follows:
UIApplication-> Window-> recursively locate the event-handling control-> call the touches method-> determine whether the touch method is implemented-> if not, the event is passed to the previous responder by default.
In the third step, the 'recursively locate the event handler control' is searched by recursively calling hitTest: withEvent: In the UIView. Therefore, you can use this event to convert the event handler. in a project, a view level is that scrollView is added as a subview, And the hitTest: withEvent: Method of view is rewritten to make scrollView respond to touch events in view, the specific code is as follows: