iOS Learning note-ios event handling Touch events

Source: Internet
Author: User

In iOS learning, touch events are the most touching, and this section focuses on the simple use of touch events.

Events in 1.iOS

2. Touch Events

2.1 The full process of touch events:
1> the event object from the top down (passed by the parent control to the child control), finds the most appropriate control to handle the event
2> calls the touches of the most appropriate control ..... Method
3> if a [super touches ...] is called; Will pass the event along the responder chain to the previous responder
4> then calls the last responder's touches .... Method

2.2 What is a responder chain?
1> Responder chain is a chain of multiple responder objects (what is the Responder object: the object that can handle the event)
2> uses the responder chain to allow multiple controls to handle the same touch event
3> How to use the chain to pass up? Who was the last responder

2.3 What is the role of the responder chain?
Allows multiple responders to respond to the event at the same time as a touch event occurs

2.4 Who is the last responder (Nextresponder)
1> If the current view is a view of the controller, then the controller is the last responder
2> If the current view is not the controller's view, then the parent control is the last responder

2.5 illustrations



iOS Learning note-ios event handling Touch events

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.