事件
分类:

响应者对象
•在iOS中不是任何对象都能处理事件,只有继承了UIResponder的对象才能接收并处理事件。我们称之为“响应者对象”
•UIApplication、UIViewController、UIView都继承自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)motionwithEvent:(UIEvent *)event;
- (void)motionEnded:(UIEventSubtype)motionwithEvent:(UIEvent *)event;
- (void)motionCancelled:(UIEventSubtype)motionwithEvent:(UIEvent *)event;
Ø远程控制事件
- (void)remoteControlReceivedWithEvent:(UIEvent *)event;
---------------代码
移动view
