UIResponder类

2024-05-03 16:48
文章标签 uiresponder

本文主要是介绍UIResponder类,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

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参数。

转自http://blog.sina.com.cn/s/blog_7ed5aa9901015et6.html

这篇关于UIResponder类的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/957188

相关文章

「OC」剪不断,理还乱——UIResponder、UIGestureRecognizer、UIControl的响应优先级探究

「OC」剪不断,理还乱——UIResponder、UIGestureRecognizer、UIControl的响应优先级探究 文章目录 「OC」剪不断,理还乱——UIResponder、UIGestureRecognizer、UIControl的响应优先级探究前言介绍UIResponderUIGestureRecognizerUIControl 正文UIGestureRecognizer和

UIResponder详解

UIResponder Class Reference Managing the Responder Chain [plain]  view plain copy 1.- (UIResponder *)nextResponder   返回接收者的下一个相应,如果没有就返回nil UIResponder类不自动存储和设置下一个响应者,而是默认返回nil。子类必须overri