iOS Development-Advanced ui-responder Chain

Source: Internet
Author: User

The process of delivering a complete touch event with a delivery response
UIApplication---UIWindow to find the most appropriate control for handling events
The control calls the touches method and determines whether the touches method is implemented, and no implementation defaults to passing the event to the previous responder--Finding the previous responder
PS: If it doesn't respond to uiapplication, then the event is discarded.
1. Responder chain: A chain that is linked together by a number of respondents
Responder: An object that inherits from Uiresponder is called a responder object
2. Previous responder (the default practice is to pass the event up the responder chain, handing the event to the previous responder for processing)
How can I tell who is the last responder of the current responder?
1> determines whether the controller is currently a view, and if so, the last responder is the controller
2> If the view is not currently a controller, the previous responder is the parent control
3. What is the use of the responder chain?
Allows multiple responders to respond to the event at the same time when a touch event is audible
Touchesbegan in the implementation file of the subclass: Add the following code to the method
[Super Touchesbegan:touches Withevent:event];

iOS Development-Advanced ui-responder Chain

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.