轻扫(swipe)手势
- (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"); }
补充:移动开发 , IOS ,