I. Classification of eventsFor iOS device users, there are three main ways to manipulate devices: Touch the screen, shake the device, and control the device through a remote controlled facility. The following three types of events are available:1. Touchscreen events (Touch event)2, motion events (motion event)3. Remote Control Events (Remote-control event)Today, as an example of touch event, the process of handling events in the Cocoa Touch framework is illustrated. First we have to introduce th
Simply put: A first-level view of the found response, if not passed to UIWindow instances and uiapplication instances, if they can not handle, discard this event ...For iOS device users, there are three main ways to manipulate devices: Touch the screen, shake the device, and control the device through a remote controlled facility. The following three types of events are available:1. Touchscreen events (Touch event)2, motion events (motion event)3. Remote Control Events (Remote-control event)
Event Delivery: The Responder Chain (Event passing, response Chain), deliveryresponder
When designing an app, we may want to respond dynamically to events. For example, to touch a screen with many different objects, you need to decide which object to send a response event and how the object receives the event.
When a user generates an event (such as a click), UIKit generates an object that contains the information of the object to be processed. Then,
processing. This initial object depends on the type of event.
Touch events. For touch events, the Window object first attempts to send an event to the view (Hit-test view) where the event occurred. The process of finding hit-test view is called hit-testing (we'll talk about it in the back).
Motioin and remote control enents. Such events, window shrimp ing send shaking-motion or remote control event to the first responder processing.
original articles, welcome reprint. Reprint Please specify: Dongsheng's blog The app interacts with the user and relies on a variety of events. An event responder object is an object that can respond to an event and process it, and the responder chain is made up of a series of linked respondents. The responder chain is very important in event handling, and the
Responder objects (Response object)The responder object is the ability to respond to events and handle events. In iOS, there is a Uiresponder class that defines all the methods of the responder object. UIApplication, UIView and other classes inherit the Uiresponder class, and the controls in UIWindow and Uikit inherit UIView, so they inherit uiresponder classes i
What is PodPods are the smallest deployable units that can be used to create and manage kubernetes calculations. A pod represents a process that runs in a cluster.Pods are like pea pods, which consist of one or more containers (such as Docker containers) that share container storage, network, and container run configuration items. The containers in the pod are always dispatched at the same time and have a c
This article link address : http://www.linuxidc.com/Linux/2015-08/121270.htmFirst, let's look at the process of generating and passing events in iOS:1. After a touch event occurs, the system adds the event to a queue event managed by uiapplication2.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
Onedetailed process of touch event handlingA touch event that occurs after a user taps the screen and, after passing through some columns, finds the most appropriate view control to handle the eventOnce the most appropriate view control is found, the touches method of the control is called to make specific event handlingTouchesbegan ...Touchesmoved ...Touchedended ...The default practice of these touches methods is to pass the event up the responder c
Responder Chain Concept:Each application has a responder chain, our view structure is an n-fork tree (a view can have multiple sub-views, a child view has only one parent view at a time), and every object that inherits Uiresponder can play a node in this N-fork tree. When the leaf node becomes the highest responder, starting from this leaf node to its parent node
iOS Development UI chapter-responder ChainOnedetailed process of touch event handlingA touch event that occurs after a user taps the screen and, after passing through some columns, finds the most appropriate view control to handle the eventOnce the most appropriate view control is found, the touches method of the control is called to make specific event handlingTouchesbegan ...Touchesmoved ...Touchedended ...The default practice of these touches metho
Simply put: a first-level view of the found response, if not passed to UIWindow instances and uiapplication instances, if they can not handle, discard this event ...For iOS device users, there are three main ways to manipulate devices: Touch the screen, shake the device, and control the device through a remote controlled facility. The following three types of events are available:1. Touchscreen events (Touch event)2, motion events (motion event)3. Remote Control Events (Remote-control event)
In iOS, events fall into three categories:
Touch events: Trigger by Touch, gesture (click, zoom, etc.)
Motion events: Triggering via an accelerator (shaking, etc.)
Remote control event: triggered by other remote device (line-controlled headset)
Only classes that inherit from Uiresponder can handle eventsHere's a touch event.When the user touches the screen, the event is encapsulated into an event instance, which contains the touch-related information, which is then distribu
The process of delivering a complete touch event with a delivery responseUIApplication---UIWindow to find the most appropriate control for handling eventsThe 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 responderPS: If it doesn't respond to uiapplication, then the event is discarded.1.
Touch eventsA variety of events occur during the user's use of the appOne, the event in iOS can be divided into 3 major types
Touch eventsAccelerometer EventsRemote control EventsResponder ObjectNot all objects in iOS can handle events, only objects that inherit Uiresponder can receive and handle events. We call it "responder object."UIApplication, Uiviewcontroller, and UIView inherit from Uiresponder, so they are both
= YESTransparentalpha = 0.0 ~ 0.01Tip: Uiimageview's userinteractionenabled default is no, so Uiimageview and its child controls cannot receive touch events by default.Detailed procedure for event delivery:
The
main window will find the most appropriate view in the view hierarchy
to handle touch events , but this is just the first step in the entire event processing process. After the appropriate view control is found, the touches method of the view control is called to do the sp
Team name: "Tear resistant" Team members: Zigaliang, Liu Weixian, Cheng Lin, Zheng Project name: "Responder" (need to improve) First time Discussion Time: 20160316 Location: the Software Personnel: All Content: Demand Analysis Main content: This time hope to develop a mobile phone software, with the function of the responder, the main application in the debate game, knowledge competition and other needs t
...Touchedended ...
The default practice of these touches methods is to pass the event up the responder chain , handing the event to the previous responder for processing
Example:
Responder ChainThe complete process of event delivery
First pass the event object from top to bottom (passed by the parent control to the c
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.