你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> IT English Collection(1)of Event(IOS)

IT English Collection(1)of Event(IOS)

編輯: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) analyze 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 結語     以上是所有內容,希望對大家有所幫助。  
  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved