iOS Event handling

Source: Internet
Author: User
Not all objects in iOS can handle events, only objects that inherit Uiresponder can receive and handle events. What we call "Responder objects" uiapplication, Uiviewcontroller, UIView inherit from Uiresponder, so they are all responder objects that are able to receive and handle the event UIView is a subclass of Uiresponder, The following 4 methods can be overridden to handle different touch events uievent to obtain which particular event touch, accelerate, touch event. By default, all UIView do not support two fingers. To set up, it is best not to engage in multiple fingers, moving without knowing which finger to engage in the occurrence and transmission of the position event: 1. After a touch event occurs, the system adds the event to an event queue managed by UIApplication 2. UIApplication takes the first event out of the event queue and distributes the event for processing, typically sending an event to the application's main window (Keywindow) 3. The main window will find the most appropriate view in the view hierarchy to handle touch events, which is the first step in the entire event processing process to draw the various view public event handling methods into the parent class __func__ gets the method in which class is called · Touch event delivery is passed from the parent control to the child control o click on the green view:uiapplication->uiwindow-> white-Green O-click on the Blue view:uiapplication->uiwindow- > White, Orange, blue Ø Click Yellow view:uiapplication->uiwindow-> White

iOS Event handling

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.