iOS gesture recognition swipe

Source: Internet
Author: User

1- (void) Viewdidload2 {3 [Super Viewdidload];4     5     //Upward6Uiswipegesturerecognizer *swipe =[[Uiswipegesturerecognizer alloc] init];7     //set the direction of the swipe8Swipe.direction =Uiswipegesturerecognizerdirectionup;9 [Self.customview addgesturerecognizer:swipe];Ten [Swipe addtarget:self action: @selector (Swipeview)]; One      A     //downward -Uiswipegesturerecognizer *swipe2 =[[Uiswipegesturerecognizer alloc] init]; -     //set the direction of the swipe theSwipe2.direction =Uiswipegesturerecognizerdirectiondown; - [Self.customview addgesturerecognizer:swipe2]; - [swipe2 addtarget:self Action: @selector (SWIPEVIEW2)]; -      +     //left -Uiswipegesturerecognizer *swipe3 =[[Uiswipegesturerecognizer alloc] init]; +     //set the direction of the swipe ASwipe3.direction =Uiswipegesturerecognizerdirectionleft; at [Self.customview addgesturerecognizer:swipe3]; - [Swipe3 addtarget:self Action: @selector (SWIPEVIEW3)]; -      -     //Right -Uiswipegesturerecognizer *swipe4 =[[Uiswipegesturerecognizer alloc] init]; -     //set the direction of the swipe inSwipe4.direction =Uiswipegesturerecognizerdirectionright; - [Self.customview addgesturerecognizer:swipe4]; to [Swipe4 addtarget:self Action: @selector (SWIPEVIEW4)]; +      -      the      * } $- (void) SwipeView4Panax Notoginseng { -NSLog (@"Swipe event Right"); the } +  A- (void) SWIPEVIEW3 the { +NSLog (@"Swipe event left"); - } $  $- (void) SwipeView2 - { -NSLog (@"Swipe event under"); the } - Wuyi- (void) Swipeview the { -NSLog (@"Swipe events on"); Wu}

iOS gesture recognition swipe

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.