【iOS】Swipe与Pan区别分析
By definition, a swipe gesture is necessarily also a pan gesture -- both involve translational movement of touch points. The difference is in the recognizer semantics: a pan recognizer looks for the beginning of translational movement and continues to report movement in any direction over time, while a swipe recognizer makes an instantaneous decision as to whether the user's touches moved linearly in the required direction.
根据定义,滑动手势也必然是平移手势 - 都涉及触摸点的平移运动。不同之处在于识别器语义:平移识别器查找平移运动的开始并继续报告随时间在任何方向上的移动,而滑动识别器立即决定用户的触摸是否在所需方向上线性移动。
By default, no two recognizers will recognize the same gesture, so there's a conflict between pan and swipe. Most likely, your pan recognizer "wins" the conflict because its gesture is simpler / more general: A swipe is a pan but a pan may not be a swipe, so the pan recognizes first and excludes other recognizers.
默认情况下,没有两个识别器会识别相同的手势,因此平移和滑动之间存在冲突。最有可能的是,你的pan识别器会赢得”冲突,因为它的手势更简单/更通用:滑动是一个平移但是平移可能不是一个滑动,所以平移首先识别并排除其他识别器。
You should be able to resolve this conflict using the delegate method gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:, or perhaps without delegation by making the pan recognizer depend on the swipe recognizer with requireGestureRecognizerToFail:.
您应该能够使用委托方法 gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:来解决此冲突,或者通过使pan识别器依赖于滑动识别器带有 requireGestureRecognizerToFail:。
With the conflict resolved, you should be able to simulate a one-finger swipe by quickly dragging the mouse. (Though as the mouse is more precise than your finger, it's a bit more finicky than doing the real thing on a device.) Two-finger pan/swipe can be done by holding the Option & Shift keys.
解决冲突后,你应该可以模拟一根手指通过快速拖动鼠标滑动。 (虽然鼠标比手指更精确,但它比在设备上做真实的东西更加挑剔。)双手平移/滑动可以通过按住Option& Shift键。
【iOS】Swipe与Pan区别分析的更多相关文章
- C++中关于[]静态数组和new分配的动态数组的区别分析
这篇文章主要介绍了C++中关于[]静态数组和new分配的动态数组的区别分析,很重要的概念,需要的朋友可以参考下 本文以实例分析了C++语言中关于[]静态数组和new分配的动态数组的区别,可以帮助大家加 ...
- Java中Comparable和Comparator接口区别分析
Java中Comparable和Comparator接口区别分析 来源:码农网 | 时间:2015-03-16 10:25:20 | 阅读数:8902 [导读] 本文要来详细分析一下Java中Comp ...
- Oracle nvchar2和varchar2区别分析
Oracle nvchar2和varchar2区别分析: [注意]VARCHAR2是Oracle提供的特定数据类型,Oracle可以保证VARCHAR2在任何版本中该数据类型都可以向上和向下兼容.VA ...
- jQuery中的.bind()、.live()和.delegate()之间区别分析
jQuery中的.bind()..live()和.delegate()之间区别分析,学习jquery的朋友可以参考下. DOM树 首先,可视化一个HMTL文档的DOM树是很有帮助的.一个简单的 ...
- jQuery中的bind() live() delegate()之间区别分析
jQuery中的bind() live() delegate()之间区别分析 首先,你得要了解我们的事件冒泡(事件传播)的概念,我先看一张图 1.bind方式 $('a').bind('click', ...
- addEventListener()及attachEvent()区别分析
Javascript 的addEventListener()及attachEvent()区别分析 Mozilla中: addEventListener的使用方式: target.addEventLis ...
- C# Parse和Convert的区别分析
原文:C# Parse和Convert的区别分析 大家都知道在进行类型转换的时候有连个方法供我们使用就是Convert.to和*.Parse,但是疑问就是什么时候用C 什么时候用P 通俗的解释大家都知 ...
- jquery中attr和prop的区别分析
这篇文章主要介绍了jquery中attr和prop的区别分析的相关资料,需要的朋友可以参考下 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别 ...
- IOS跟ANDROID的区别
大家总是会纠结哪个手机系统会更加适合自己,那就由小编我简要介绍一下IOS和安卓的区别吧! 运行机制:安卓是虚拟机运行机制,IOS是沙盒运行机制.这里再说明一下这两者的主要不同之处.安卓系统中应用程序的 ...
随机推荐
- html格式化输出JSON( 测试接口)
将 json 数据以美观的缩进格式显示出来,借助最简单的 JSON.stringify 函数就可以了,因为此函数还有不常用的后面2个参数. 见MDN https://developer.mozilla ...
- Object.defineProperty和Object.freeze、Object.seal
目录 一 Object.defineProperty 1.1 用法 1.2 数据描述 1.2.1 value 1.2.2 writable 1.2.3 enumerable 1.2.4 configu ...
- [TimLinux] systemd 精通CentOS7系统启动systemd
1. 介绍 systemd: 在12种不同类型的实体单元(entity unit)间提供了一个依赖关系系统. 2. 几个概念 实体单元:为系统的启动和维护封装多种对象(object).主体单元在单元配 ...
- HDU2482-Transit search(地图还原+SPFA)
Henry decides to develop a web site, which will provide the service of transit search. But he can on ...
- Centos7使用离线安装包rpm安装MySQL5.6
参考地址: https://blog.csdn.net/ai_64/article/details/100557530 https://dev.mysql.com/doc/refman/5.6/en/ ...
- BeetleX之TCP服务应用详解
BeetleX是.net core平台下的一个开源TCP 通讯组件,它不仅使用简便还提供了出色性能的支持,可以轻易让你实现上百万级别RPS吞吐的服务应用.组件所提供的基础功能也非常完善,可以让你轻易扩 ...
- 你不知道的JavaScript(中)读书笔记(二)
第三章 原生函数 常用的原生函数(内建函数)有: String() Number() Boolean Array() Object() Function() RegExp() Date() Erroe ...
- poj 1741 Tree (树的分治)
Tree Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 30928 Accepted: 10351 Descriptio ...
- python利用setsockopt获得端口重用
server.setsockopt(SOL_SOCKET,SO_REUSEADDR,1) 假如端口呗socket使用过,并且利用socket.close()来关闭连接,但此时端口还没有释放,要经过一个 ...
- SVN重新定位操作流程
因服务器其他系统需要SVN原来使用的443端口无法继续使用需要更换,服务器SVN端口已更新为8443,现将个人电脑SVN文件夹路径重新定位流程展示如下: 确定即修改成功!