iOS seven gestures (pan, pinch, swipe, screen edge swipe) gesture Recognizer method

Source: Internet
Author: User

Using gestures is simple and divided into two steps:
    1. Creates a gesture instance. When creating gestures, specify a callback method that is called when the gesture starts, changes, or ends.
    2. Added to the view that needs to be recognized. Each gesture corresponds to only one view, and when the screen touches within the bounds of the view, if the gesture is the same as the reservation, the callback method is used.

(iv), panning gestures

(v), pinch gestures

(vi), swipe gesture

To change a picture on a view by swiping gestures

(vii), screen edge swipe gesture

Changing the background color of a view with a screen swipe gesture

(eight), simultaneous triggering of two view gesturesThe gesture is mutually exclusive, and if you want to trigger the snake and Dragon view at the same time, you need to implement the Protocol

Uigesturerecognizerdelegate,

and returns Yes in the Protocol method.

Set self as proxy to gesture

iOS seven gestures (pan, pinch, swipe, screen edge swipe) gesture Recognizer method

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.