-
-
Save hanfengs/8584b7f54c4065b06f34c76326d07f23 to your computer and use it in GitHub Desktop.
[滑动手势]
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
UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)]; | |
[recognizer setDirection:(UISwipeGestureRecognizerDirectionLeft)]; | |
[self.view addGestureRecognizer:recognizer]; | |
- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer{ | |
if(recognizer.direction == UISwipeGestureRecognizerDirectionDown) { | |
NSLog(@"swipe down"); | |
} | |
if(recognizer.direction == UISwipeGestureRecognizerDirectionUp) { | |
NSLog(@"swipe up"); | |
} | |
if(recognizer.direction == UISwipeGestureRecognizerDirectionLeft) { | |
if (self.isNext && self.scoreModel) { | |
[self clickNextBtn:nil]; | |
} | |
} | |
if(recognizer.direction == UISwipeGestureRecognizerDirectionRight) { | |
NSLog(@"swipe right"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment