IOS gesture Recognizer Overview

Source: Internet
Author: User

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
    • Edges

>
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.