Gesture Recognizer 有感或是笔记

`1.Specifying a One-Way Relationship Between Two Gesture Recognizer

为了在一个view中(有两个gesture recognize)制造一个单线程的关系,比如你想让旋转手势成功响应并且阻止响应捏合手势,可以do like this:

[rotationGestureRecognizer canPreventGestureRecognizer: pinchGestureRecognizer];

(注意看完之后一定要去看 Creating a Custom Gesture Recognizer)

如果不想阻止,就使用如下方法:

gestureRecognizer:shouldRecognizerSimutaneouslyWithGestureRecognizer:

By default, a pinch gesture prevents a rotation and vice versa(反之亦然) because two gestures cannot be recognized at the same time.

对于这之前的内容海需要好好的研读。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容