星空网 > 软件开发 > 操作系统

1.0 iOS中的事件

在用户使用app过程中,会产生各种各样的事件,iOS中的事件可以分为3大类型:
UIKit可识别三种类型的输入事件:
  • 触摸事件
  • 加速计事件 / 运动事件
  • 远程控制事件
 
1.0 iOS中的事件images/loading.gif' data-original="http://images2015.cnblogs.com/blog/731328/201601/731328-20160115173921241-420122468.png" width="609" height="288" />
 
 
 
 UIResponder - 响应者对象

 
概念:
在iOS中不是任何对象都能处理事件,只有继承了UIResponder的对象才能接收并处理事件。
 
 
成员:
UIApplication、UIViewController、UIView都继承自UIResponder,因此它们都是响应者对象,都能够接收并处理事件
 
 
UIResponder的内部方法:
1 //触摸事件2 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;3 - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;4 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;5 - (void)touchesCancelled:(nullable NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event;6 - (void)touchesEstimatedPropertiesUpdated:(NSSet * _Nonnull)touches NS_AVAILABLE_IOS(9_1);

1 //加速计事件2 - (void)motionBegan:(UIEventSubtype)motion withEvent:(nullable UIEvent *)event NS_AVAILABLE_IOS(3_0);3 - (void)motionEnded:(UIEventSubtype)motion withEvent:(nullable UIEvent *)event NS_AVAILABLE_IOS(3_0);4 - (void)motionCancelled:(UIEventSubtype)motion withEvent:(nullable UIEvent *)event NS_AVAILABLE_IOS(3_0);

//远程控制事件- (void)remoteControlReceivedWithEvent:(nullable UIEvent *)event NS_AVAILABLE_IOS(4_0);

 

 




如有疑问,请发送邮件至 shorfng@126.com 联系我。
 
By:蓝田(Loto)

 


 
 
 
 



原标题:1.0 iOS中的事件

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

健身器材:https://www.goluckyvip.com/tag/11414.html
网购保税进口:https://www.goluckyvip.com/tag/11415.html
Perfee:https://www.goluckyvip.com/tag/11416.html
国际电商:https://www.goluckyvip.com/tag/11417.html
lazada海外仓:https://www.goluckyvip.com/tag/11418.html
安全法:https://www.goluckyvip.com/tag/11419.html
加拿大本地账户开立是否需要加拿大身份? :https://www.xlkjsw.com/news/92266.html
亚龙湾有什么景点必看 亚龙湾有哪些景点:https://www.vstour.cn/a/408228.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流