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

The corresponding method:

- initWithTarget:action:- addTarget:action:- removeTarget:action:
- locationInView:- locationOfTouch:inView:- numberOfTouches

Property:

    • Stated
    • View
    • Enable
    • Cancelstouchesinview
    • Delaystouchesbegin

      Here's a way to be very important, when you need to use a double-tap gesture, the click Gesture also appears. This is the time to use the following method:

 - 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, if you need an increment value, you need to rotation 0 each time)
    • Velocity (number of arcs per second, radius 1)
Uipinchgesturerecognizer
    • Scale (also requires scale 1 if you need to get the increment value)
    • Velocity (number of scale per second)
Uilongpressgesturerecognizer
    • Minimumpressduration
    • Numberoftouchesrequired
    • Numberoftapsrequired
    • Alowablemovement (Allow move)
Uipangesturerecognizer
    • Maximumnumberoftouches
    • Minimumnumberoftouches
- translationinView:- setTranslation:inView:- velocityView:  (速度以 CGpoint 方式返回,可以分解为 x 和 y 两个方向的速度 )
Uiscreenedgepangesturerecognizer
    • Edges

>
This gesture is somewhat different from the panning gesture, which is a part of the edge of the screen to produce an effect that requires special handling when used, or conflicts with the panning gesture. Because it inherits Uipangesturerecognizer.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

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.