Skip to content

Instantly share code, notes, and snippets.

@yuxiangq
Last active August 29, 2015 14:09
Show Gist options
  • Save yuxiangq/ad389e9c32eaec44fc78 to your computer and use it in GitHub Desktop.
Save yuxiangq/ad389e9c32eaec44fc78 to your computer and use it in GitHub Desktop.
UISwipeGestureRecognizer的用法
-(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