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.
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
= 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
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)
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
...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
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 child control), and find the most appropriate control to handle the event. Call the touches of the most a
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 child control), and find the most appropriate control to handle the event. Call the touches of the most a
Touch the responder Chain Event : An action captured by the hardware to the userIOS of Events : Touch Time , Shaking Events , Remote Control Events Touch Events : support multi-touch , up to one point , 6 s future devices support pressure-sensitive recognition How do I capture a user's touch events ? 1. The user can touch all the UIView or UIView sub-classes 2. Create a UIView Subclass 3. several ways to rewrite UIViewand touch-related methods
1. If the parent control cannot receive touch events, then the child controls will not be able to receive touch events.2, in the following cases, the control is unable to receive touch events1. Do not receive user Exchange userinteractionenable= No;2. Hide Hiden = YES;3. Transparent alpha = 0.0 ~ 0.01;Tip: Uiimageview's userinteractionenable defaults to No, so Uiimageview and his child controls do not receive touch events by default.3, the complete process of the event1. Pass the event object fr
A variety of operational events are encountered in iOS development and can be responded to by programs.
First, when an event response occurs, you must know who is responding to the event. In iOS, the responder chain responds to events, all event-response classes are uiresponder subclasses, and the responder chain is a hierarchy of different objects, each of which gets an opportunity to respond to event mes
Event Transfer Process of the responder chainEvent Transfer Process of the responder chain1. hitText Method1. The hitText method calls this method when an event is passed to a control.2. hitText: Find the most appropriate view.3. hitText Method1) Can I determine whether the window can handle the event? If not, it means that the window is not the most suitable view, and it does not look for a view that is mo
The event delivery process for the responder chainFirst,Hittext Method1.the Hittext methodwhen an event is passed to a control, the control calls this method2.Hittextfunction:to find the most suitableView. 3. Hittext Method1),determine if the window can handle events?if not, it means that the window is not the most suitableView, and will not find a better fit than yourself.View,Direct returnNil,Noticeuiapplication, there is no most suitableView. 2),de
The event Transfer Process of the responder chain, and response event TransferEvent Transfer Process of the responder chain1. hitText Method1. The hitText method calls this method when an event is passed to a control.2. hitText: Find the most appropriate view.3. hitText Method1) Can I determine whether the window can handle the event? If not, it means that the window is not the most suitable view, and it do
Touch eventsA variety of events occur during the user's use of the appEvents in iOS can be divided into 3 major types触摸事件:加速计事件:远程控制事件:Responder 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
Using View Controllers in the Responder ChainUsing the view controller in the response chainView controllers is descendants of the UIResponder class and is therefore capable of handling all sorts of events. When a-view does not respond to a given event, it passes, it Superview, traveling up the view hierarchy all The to the root view. However, if any view in the chain are managed by a view controller, it passes the event to the View controller object
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.