TouchesCancelled: withEvent:
Responder chain
Hit-test view
HitTest: withEvent: the process is as follows:
First, call the pointInside: withEvent: Method of the current view to determine whether the touch point is in the current view;
If NO is returned, hitTest: withEvent: nil is returned;
If YES is returned, hitTest: withEvent: message is sent to all subviews in the current view. The traversal order of all subviews is from the top-level view to the bottom-level view, that is, it traverses forward from the end of the subviews array until a subview returns non-empty objects or all subviews are traversed;
If a child view returns a non-null object for the first time, the hitTest: withEvent: method returns this object, and the process ends;
If none of the Child views are returned, the hitTest: withEvent: method returns itself (self ).
Event Transfer Mechanism
View is passed to the next layer. If the previous layer does not affect the operation, it will continue to be passed to the next layer and be passed to rootVC. If the rootvc does not support the operation, it will be passed to windows, if windows does not support the event, the event will be passed to the application. If it does not support the event, the touch event will be discarded.
Reference: iOS event mechanism Cocoa Touch event handling process-responder chain