首页 > 其他 > 详细

触摸事件

时间:2017-04-02 21:53:30      阅读:202      评论:0      收藏:0      [点我收藏+]

iOS中的事件

在用户使用app过程中,会产生各种各样的事件
iOS中的事件可以分为3大类型

技术分享

 

响应者对象

在iOS中不是任何对象都能处理事件,只有继承了UIResponder的对象才能接收并处理事件。我们称之为“响应者对象
UIApplication、UIViewController、UIView都继承自UIResponder,因此它们都是响应者对象,都能够接收并处理事件

 

UIResponder

UIResponder内部提供了以下方法来处理事件
Ø触摸事件

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;

- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;

 

Ø加速计事件

- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event;

- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event;

- (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event;

 

Ø远程控制事件

- (void)remoteControlReceivedWithEvent:(UIEvent *)event;

 

触摸事件

原文:http://www.cnblogs.com/laugh/p/6659860.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!