当前位置:编程学习 > wap >>

IT English Collection(1)of Event(IOS)

1 前言
    本文单词内容来自Xcode文档的Event(IOS)一篇文章之中,主要介绍了用户的手势和触摸事件。
2 单词列表
2.1 原文
Events in iOS represent fingers touching views of an application or the user shaking the device. One or more fingers touch down on one or more views, perhaps move around, and thenlift from the view or views. As this is happening, iPhone’s Multi-Touch systemregisters these touches as events and sends them to the currently active application forprocessing. Thisrange of possible touch behaviors, from the moment the firstfeature touches down on a view until the last finger lifts from that view, defines a multitouch sequence. Applications (and framework objects) 易做图yze multitouch sequences, usually todetermine whether they are gestures such aspinches and swipes.
The operating system may also generatemotion events when users shake the devices. These aredelivered as discrete events to an application.
Objects Represent Fingers Touching a View
Fingers touching a view are represented by UITouch objects. Touch objects include information such as the view the finger is touching, the location of the finger in the view, a timestamp, and a phase. A touch object goes through several phases during a multi-touch sequence in a given order:
UITouchPhaseBegan
The finger touched down on a view.
UITouchPhaseMoved
The finger moved on that view or an adjacent view.
UITouchPhaseEnded
The finger lifted from a view.
A touch object can also be aStationaryphase or be canceled. Touch objects arepersistent through a multitouch sequence, but their statemutates. An application packages touch objects in UIEvent objects when it delivers them to the view for handling.
 
The Delivery of Touch Objects Follows a Defined Path
 
In the main event loop, the application object gets (raw) touch events in its event queue, packages them as UITouch objects in UIEvent objects, and sends them to the window of the view in which the touch occurred. The window object, in turn, sends these objects to this view, which is known as the hit-test view. If this view cannot handle the touch event (usually because it hasn’t implemented the requisite event-handling methods) the event travels up the responder chain until it is either handled or discarded.
 
To Handle Events You Must Override Four Methods
 
Responder objects, which include custom views and view controllers, handle events by implementing four methods declared by the UIResponder class:
touchesBegan:withEvent: is called for touch objects in the Began phase.
touchesMoved:withEvent: is called for touch objects in the Moved phase.
touchesEnded:withEvent: is called for touch objects in the Ended phase.
touchesCancelled:withEvent: is called when some external event—for example, an incoming phone call—causes the operating system to cancel touch objects in a multitouch sequence.
The first argument of each method is a set of touch objects in the given phase. The second argument is a UIEvent object that tracks all touch objects in the current multitouch sequence.
By default, a view is able to receive multitouch events. Instances of some UIKit view classes, however, cannot receive multitouch events because their userInteractionEnabled property is set to NO. If you are subclassing these classes, and want to receive events, be sure to set this property to YES. Although custom views and view controllers should implement all four methods, subclasses of UIKit view classes need only implement the method corresponding to the phase or phases of interest; in this case, however, they must be sure to call the superclass implementation first.
Handling Motion Events
Through a device’s accelerometer, the operating systemdetects specific motions and sends these as events to the active application. (Currently the only supported motion is shaking the device.) The first responder first receives these motion events (as UIEvent objects) and if it cannot handle them they travel up the responder chain. The system tells an application only when the motion starts and when it stops; the corresponding UIResponder methods are motionBegan:withEvent: and motionEnded:withEvent:. The only information passed to the handling responder object is the dataencapsulated by the event object: event type (in this case, UIEventTypeMotion), event subtype (in this case, UIEventSubtypeMotionShake), and a timestamp .
2.2 生词
lift from 从…抬起
registers ['rɛdʒɪstɚ] 存储
processing [prəu'sesiŋ] 加工
range [reɪn(d)ʒ] 范围
feature ['fiːtʃə]  特征
determine [dɪ'tɜːmɪn]  决定
pinch [pɪn(t)ʃ]  捏
swipe [swaɪp] 滑动
motion ['məʊʃ(ə)n]  动作
deliver [dɪ'lɪvə] 传送
discrete [dɪ'skriːt]  不连续的
represent [reprɪ'zent] 代表
phase [feɪz]  相位;阶段
adjacent [ə'dʒeɪs(ə)nt]  邻近的
delivery [dɪ'lɪv(ə)rɪ]  交付;投递
raw [rɔː]adj.  生的;未加工的
in turn  轮流
hit-test 点击测试
requisite ['rekwɪzɪt]  adj. 必备的;需要的
discard [dɪ'skɑːd]vt. 抛弃;放弃;丢弃
external [ɪk'stɜːn(ə)l; ek-]adj. 外部的;表面的;
track [træk]vt. 追踪;通过;
corresponding [,kɒrɪ'spɒndɪŋ]adj. 相当的,相应的;
in this case  既然这样,假若这样
accelerometer [ək,selə'rɒmɪtə]n. [航][物] 加速计
detect [dɪ'tekt]vt. 察觉;发现;探测
encapsulated [ɪn'kæpsəleɪtɪd]adj. 密封的;
stationary['steɪʃ(ə)n(ə)rɪ]adj.固定的;静止的;
 
mutates[mjuː'teɪt]vi. 变化,产生突变
 
persistent[pə'sɪst(ə)nt]adj.固执的,坚持的;
 
 
Interaction [ɪntər'ækʃ(ə)n]n. 互动
 
3 结语
    以上是所有内容,希望对大家有所帮助。
 
补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,