Gesture Recognizer iOS gesture recognizer (Uigesturerecognizer)
- Tap gestures (UITapGestureRecognizer)
- Swipe gesture (Uiswipegesturerecognizer)
- Rotation gesture (Uirotationgesturerecognizer)
- Pinch gesture (Uipinchgesturerecognizer)
- Long-press gesture (Uilongpressgesturerecognizer)
- Pan gesture (Uipangesturerecognizer)
- Screen edge panning gesture (Uiscreenedgepangesturerecognizer)
Uigesturerecognizer
Its corresponding method:
- initWithTarget:action:- addTarget:action:- removeTarget:action:
- locationInView:- locationOfTouch:inView:- numberOfTouches
Property:
- Stated
- View
- Enable
- Cancelstouchesinview
-
Delaystouchesbegin
Here's one way, it's important, when you need a double-tap gesture, the click Gesture also appears. This is the time to use the following methods:
- requireGestureRecognizerToFail:(eg: 单击须要双击失败)
UITapGestureRecognizer
- numberoftapsrequired (number of clicks)
- Numberoftouchesrequired (with a few fingers)
Uiswipegesturerecognizer
- direction (moving direction)
- Numberoftouchesrequired
Uirotationgesturerecognizer
- Rotation (This is the absolute value of the rotation angle, not the increment, assuming that the increment value is required, each rotation 0)
- Velocity (number of arcs per second, radius 1)
Uipinchgesturerecognizer
- Scale (if you need to get the increment value, you need the scale 1)
- Velocity (number of scale per second)
Uilongpressgesturerecognizer
- Minimumpressduration
- Numberoftouchesrequired
- Numberoftapsrequired
- Alowablemovement (consent to move)
Uipangesturerecognizer
- Maximumnumberoftouches
- Minimumnumberoftouches
- translationinView:- setTranslation:inView:- velocityView: (速度以 CGpoint 方式返回,能够分解为 x 和 y 两个方向的速度 )
Uiscreenedgepangesturerecognizer
>
This gesture is somewhat different from the panning gesture, which results from the ability of some of the edges of the screen, and is usually handled with special care, otherwise it conflicts with the panning gesture. Because it inherits Uipangesturerecognizer
IOS gesture Recognizer Overview