- (void)viewDidLoad
{
[super viewDidLoad];
/*instantiate the object */
UISwipeGestureRecognizer *swipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipes:)];
/*Swipes that are performed from right to left are to be detected*/
swipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
/*just one finger needed*/
swipeGestureRecognizer.numberOfTouchesRequired = 1;
/*add it to the view*/
[self.view addGestureRecognizer:swipeGestureRecognizer];
}
-(void)handleSwipes:(UISwipeGestureRecognizer *)paramSender{
NSLog(@"swipe to left");
}
轻扫(swipe)手势
最新推荐文章于 2023-06-19 12:05:40 发布