Last active
August 29, 2015 14:09
-
-
Save yuxiangq/ad389e9c32eaec44fc78 to your computer and use it in GitHub Desktop.
UISwipeGestureRecognizer的用法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)initSwipeGestureRecognizer{ | |
UISwipeGestureRecognizer *swipeGestureRecognizer=[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipe:)]; | |
[self.view addGestureRecognizer:swipeGestureRecognizer]; | |
} | |
-(void)swipe:(UISwipeGestureRecognizer*)sender{ | |
switch(sender.direction){ | |
case UISwipeGestureRecognizerDirectionRight: | |
{ | |
break; | |
} | |
case UISwipeGestureRecognizerDirectionLeft: | |
{ | |
break; | |
} | |
case UISwipeGestureRecognizerDirectionUp: | |
{ | |
break; | |
} | |
case UISwipeGestureRecognizerDirectionDown: | |
{ | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment