Birth and delivery of events 01

Source: Internet
Author: User

1. What is the event about birth and delivery? ?

When a touch event occurs, the system adds the event to an event queue managed by UIApplication.
->uiapplication takes the first event out of the event queue and distributes the event for processing.
The main window will find the most appropriate view in the view hierarchy to handle touch events
The pass-through of the touch event is passed from the parent control to the child control.
-If a parent control cannot receive an event, the child controls inside it are not able to receive the event.
2. What happens when a control is not able to receive events?->1. Not able to handle events when no user interaction is received
userinteractionenabled = NO
->2. Cannot receive events when a control is hidden
Hidden = yes at the time
->3. Cannot receive events when a control is transparent white
Note: Uiimageview's userinteractionenabled default is no,
So Uiimageview and its child controls are not allowed to receive touch events by default 3. The complete process of event delivery?->1. When an event is generated, the event is added to an event queue managed by the uiapplication.
->2. UIApplication takes the first event from the event queue and passes it to the main window that sends the event to the application.
->3. The main window calls the HitTest method to find the most appropriate view control, and when found, invokes the touches method of the view control to do something specific.
->4. When the touches method is called, its default practice is to pass the event along the responder chain,
->5. Passed to the previous responder, and then the previous responder's touches method is called

Birth and delivery of events 01

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.