iOS手势学习UIGestureRecognizer & cocos2d 手势推荐

手势识别类型:

UILongPressGestureRecognizer   // 长按
UIPanGestureRecognizer      // 慢速拖动
UIPinchGestureRecognizer     // 两指向內或向外拨动
UIRotationGestureRecognizer     // 旋转
UISwipeGestureRecognizer      // 快速滑动
UITapGestureRecognizer       // 点击

手势协议:

@protocol UIGestureRecognizerDelegate <NSObject>
@optional
// called when a gesture recognizer attempts to transition out of UIGestureRecognizerStatePossible. returning NO causes it to transition to UIGestureRecognizerStateFailed
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer;// called when the recognition of one of gestureRecognizer or otherGestureRecognizer would be blocked by the other
// return YES to allow both to recognize simultaneously. the default implementation returns NO (by default no two gestures can be recognized simultaneously)
//
// note: returning YES is guaranteed to allow simultaneous recognition. returning NO is not guaranteed to prevent simultaneous recognition, as the other gesture's delegate may return YES
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;// called before touchesBegan:withEvent: is called on the gesture recognizer for a new touch. return NO to prevent the gesture recognizer from seeing this touch
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;@end

手势优先级:

// create a relationship with another gesture recognizer that will prevent this gesture's actions from being called until otherGestureRecognizer transitions to UIGestureRecognizerStateFailed
// if otherGestureRecognizer transitions to UIGestureRecognizerStateRecognized or UIGestureRecognizerStateBegan then this recognizer will instead transition to UIGestureRecognizerStateFailed
// example usage: a single tap may require a double tap to fail
- (void)requireGestureRecognizerToFail:(UIGestureRecognizer *)otherGestureRecognizer;

各种手势Demo:UIGestureRecognizer学习笔记

cocos2d手势库推荐:SFGestureRecognizers  github链接

iOS手势学习UIGestureRecognizer cocos2d 手势推荐相关推荐

  1. ios开发学习-手势交互(Gesture)效果源码分享

    qianqianlianmeng ios开发学习-手势交互(Gesture)效果源码分享 All Around Pull View 介绍:实现视图四个方向(上下左右)都能够拖动更新(pull to r ...

  2. iOS 一一 触摸事件和手势

    iOS触摸事件和手势 文章出处:http://www.jianshu.com/p/cb0314b72883 在iOS中,触摸表示用户手指触击屏幕及在屏幕上移动时,系统不断发送给应用程序对象,一个UIT ...

  3. iOS开发概述-12.手势处理

    1.手势识别概述 如果想监听一个view上面的触摸事件,之前的做法是 自定义一个view 实现view的touches方法,在方法内部实现具体处理代码 但是通过touches方法监听view触摸事件, ...

  4. iOS手势全埋点:轻拍手势、长按手势、捏合手势、旋转手势、轻扫手势、平移手势、屏幕边缘平移手势

    文章目录 前言 I.手势全埋点方案 1.1 轻拍手势全埋点 1.2 长按手势全埋点 II .右划返回的事件与scrollView滚动事件冲突的解决方案 see also 前言 由于UIGestureR ...

  5. ios事件-触摸事件2(手势 和 pointInSide()、hitTest()、touchesBegan()、touchesMoved()、touchesEnded()的关系)

    ios事件-触摸事件2(手势 和 pointInSide().hitTest().touchesBegan().touchesMoved().touchesEnded().touchesCancell ...

  6. 【转】iOS开发学习计划

    转自:简书 一.C语言基础 基本数据类型.基本运算.函数.数组.字符串.指针.结构体.预处理指令.枚举.文件操作.内存管理 二.Objective-C 1.Objective-C基本语法 数据类型.表 ...

  7. vue 多点触控手势_移动端手势事件(多指操作)

    在移动端开发中,现有的手势事件只有IOS上的浏览器支持,因此对其他设备上的浏览器手势事件我们必须在移动端的touchstart.toucmove.touchend事件上进行改造升级,下面就介绍下升级改 ...

  8. [源码、文档、分享] iOS/iPhone学习系列、代码教程(转)

    iOS/iPhone学习系列.代码教程----~~~持续更新中~~~ http://www.devdiv.com/iOS_iPhone-iOS_iPhone%E5%AD%A6%E4%B9%A0%E7% ...

  9. iOS完整学习路线图

    --http://blog.csdn.net/q199109106q/article/details/8596506 --http://edu.51cto.com/roadmap/view/id-7. ...

最新文章

  1. sql server2005 常用语句
  2. JavaScript常用技巧之数组操作
  3. mac电脑 显示隐藏文件 取消显示隐藏文件
  4. stm32f401 i2s 时序图
  5. ViewDragHelper
  6. 国际电信联盟:3GPP系标准成为唯一被认可的5G标准
  7. ASP.NET的ADO(ActiveX Data Objects)
  8. String中的==与Empty
  9. DiskFileUpload上传文件并获取前端表单数据
  10. 12306ByTicket1.1操作手册
  11. Excel连接MySQL数据库进行数据的可视化
  12. CSS 边框 border属性
  13. Matlab fprintf
  14. 抖音短视频教程VIP培训课程(2019实时更新中)
  15. BI_开发_问题:ORA-26002: Table DWH.W_XACT_TYPE_D has index defined upon it.
  16. 红米5无线网连接上但是没有网络连接服务器,红米路由器wifi已连接但无法访问互联网怎么办 | 192路由网...
  17. 基于微信小程序的微相亲平台的设计与实现
  18. Application生命周期
  19. Problem J.果粒橙
  20. 案例学习-万事达卡全球业务服务中心(GBSC)

热门文章

  1. Vue按需加载提升用户体验
  2. java笔记:第6章 面向对象程序设计
  3. 支持IE,Firefox的日历控件
  4. Android 中Touch(触屏)事件传递机制
  5. Android 4.3 新特性
  6. android:windowSoftInputMode属性使用
  7. Android Map开发(MrMap源代码)
  8. JAVA NIO 简介 (netty源码死磕1.1)
  9. Node连接MySQL并封装其增删查改
  10. Berg Insight:移动M2M连接将实现长足发展