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.

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

你可能感兴趣的:(Gesture Recognizer 有感或是笔记)