The complete process of event handling
1> first passes the event object from top to bottom (passed by the parent control to the child control), and finds the most appropriate control to handle the event.
2> calls the touches of the most appropriate control .... method
3> if [super touches ...] is called, the event is passed up the responder chain to the previous responder
4> then calls the last responder's touches .... method
How to determine the previous responder
1> If the current view is a view of the controller, then the controller is the last responder
2> If the current view is not the controller's view, then the parent control is the last responder
The event delivery process for the responder chain
- If the view controller is present, it is passed to the controller, and if the controller does not exist, it is passed to its parent view
- In the top-most view of the view hierarchy, if you cannot process the received event or message, it passes the event or message to the Window object for processing
- If the window object is not processed, it passes the event or message to the UIApplication object
- If UIApplication cannot process the event or message, it is discarded
Response person
- The touches method is to pass the event up the chain in response to the previous responder for processing.
- The default method [Super touches ... withevent ...];
- A control that responds to an event must implement the override touches method, handle the event in its method, and implement the response.
- The principle of multi-control processing is 1 on the responder chain, and is the parent control of its control 2 and implements the touches method.
IOS-Event handling process (supplemental)