iPhone摇一摇
来源:互联网 发布:淘宝短信营销资料 编辑:程序博客网 时间:2024/05/18 00:06
监控摇一摇的方法
方法1:通过分析加速计数据来判断是否进行了摇一摇操作(比较复杂)
方法2:iOS自带的Shake监控API(非常简单)
判断摇一摇的步骤:实现3个摇一摇监听方法
-(void)motionBegan:(UIEventSubtype)motionwithEvent:(UIEvent*)event/**检测到摇动*/
-(void)motionCancelled:(UIEventSubtype)motionwithEvent:(UIEvent*)event/**摇动取消(被中断)*/
-(void)motionEnded:(UIEventSubtype)motionwithEvent:(UIEvent*)event/**摇动结束*/
//// ViewController.m#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{ NSLog(@"用户摇一摇");}- (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event{ // 摇一摇被打断(电话)}- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{ // 摇一摇结束}@end
0 0
- iPhone摇一摇
- IPhone
- iPhone
- iPhone
- iphone
- iphone
- iphone
- iphone
- iphone
- iPhone
- iphone
- iPhone
- iphone
- iphone
- iPhone
- iphone--------------------------------------
- Iphone
- iphone
- Struts2配置问题
- python 多线程下载图片
- DevExpress ASP.NET 使用经验谈(9)- Dev控件客户端事件 ClientSideEvents
- HDU-1133Buy the Ticket 卡特兰数买票问题
- 已经证实提高机器学习模型准确率的八大方法
- iPhone摇一摇
- ASPxUploadControl上传
- MIC编程
- Linux下安装webstorm
- 功能测试(二)软件的易用性
- 动画之逐帧
- 【算法】矩阵走法问题
- 内存中的堆与栈到底是怎么回事?
- getRecordArray