UIResponder类的介绍

来源:互联网 发布:免费手机小号软件 编辑:程序博客网 时间:2024/05/21 22:29


         UIResponder类定义了对象相应和控制事件的接口,他是UIApplication、UIView的超类,这类的实例通常被称为应答对象。

  

           这个类中主要的时间控制方法是:touchesBegan:withEvent:, touchesMoved:withEvent:,touchesEnded:withEvent: , 和 touchesCancelled:withEvent:
         其实例方法包括:
   
     becomeFirstResponder :通告接受者对象称为当前的第一响应者对象(- (BOOL)becomeFirstResponder )
      主要的时间控制方法:
       touchesBegan:withEvent:通知调用者当有一根或者多根手指触摸到了视图或者窗口
       - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
: 通知接收者当系统发出取消事件的时候(比如低内存消耗的警告框)
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event :当一个触摸事件结束时发出的UITouch实例对象
     - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event :告诉接收者一个或者多个手指在视图或者窗口上触发移动事件。
默认不允许多点触摸。如果要接收多点触摸事件你必须发setMultipleTouchEnabled: 这个消息给接收的视图实例对象并传递YES参数

0 0