Gestures and Touches(Chapter 8 of The iPhone™ Developer’s Cookbook)

  Touches have life cycles. Each touch can pass through any of five phases that represent the progress of the touch within an interface. These phases are as follows:
   UITouchPhaseBegan—Starts when users touch the screen.
   UITouchPhaseMoved—Means a touch has moved on the screen.
   UITouchPhaseStationary—Indicates that a touch remains on the screen surface but that there has not been any movement since the previous event.
   UITouchPhaseEnded—Gets triggered when the touch is pulled away from the screen.
   UITouchPhaseCancelled—Occurs when the iPhone OS system stops tracking a particular touch.This usually occurs due to a system interruption, such as when the application is no longer active or the view is removed from the window.
  Predefined callback methods handle the start, movement, and release of touches from the screen. Corresponding to the phases you’ve already seen, the methods involved are as follows. Notice that UITouchPhaseStationary does not generate a callback. 
  touchesBegan:withEvent:—Gets called at the starting phase of the event, as the user starts touching the screen.
   touchesMoved:withEvent:—Handles the movement of the fingers over time.
   touchesEnded:withEvent:—Concludes the touch process, where the finger or fingers are released. It provides an opportune time to clean up any work that was handled during the movement sequence.
   touchesCancelled:WithEvent:—Called when Cocoa Touch must respond to a system interruption of the ongoing touch event.

 

转载于:https://www.cnblogs.com/zhtf2014/archive/2010/12/31/1923089.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值