1. Touch the screen with your fingers to generate an event object
2. The system will add this event object to the event queue (first-in-first-out ).
3. The UIApplication extracts the event object from the event queue for processing.
4. UIApplication will first pass the event object to the main UIWindow
(Of course, you must first check whether the UIWindow can receive and pass events)
5. UIWindow traverses all the child controls to see if the touch point falls on a child control:
1> If the touch point is not on the Child control, the UIWindow will directly process the event and the event will be passed.
2> If the touch point falls on the Child control v1, traverse all the child control v1 and repeat the previous step 5.
(Traverse from the last child Control)
6. finally, a UIView object that is most suitable for event processing will be obtained, and a corresponding message will be sent to this UIView object, that is, the corresponding method of calling UIView (touchesBegan ...), notify it to be touched
(That is, the internal processing process of touchesBegan, touchesMoved, and touchesEnded)
// If the three methods are overwritten and the super method is not called, the default method of the parent class is ignored.
1. Default practice:
1> the event object is passed up along the responder chain and will be passed to the UIApplication.
2> If the intermediate chain is broken, it will not be passed up.
2. If the default method of the parent class is overwritten, the event will not be passed up, And the responder chain will be disconnected.
3. Event transmission and event processing are basically inverse processes.