我如何识别一个UISwipeGestureRecognizer
,UISwipeGestureRecognizerDirectionUp
然后直接在不抬起手指的情况下识别一个UISwipeGestureRecognizerDirectionDown
识别器?
基本上,UISwipeGestureRecognizers
当我改变方向时,我希望在不抬起手指的情况下识别多个。
到目前为止我的代码...
- (void)viewDidLoad {
UISwipeGestureRecognizer *swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(screenSwipedUp)];
swipeUp.numberOfTouchesRequired = 1;
swipeUp.direction = UISwipeGestureRecognizerDirectionUp;
swipeUp.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:swipeUp];
UISwipeGestureRecognizer *swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(screenSwipedDown)];
swipeDown.numberOfTouchesRequired = 1;
swipeDown.direction = UISwipeGestureRecognizerDirectionDown;
swipeDown.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:swipeDown];
}
- (void)screenSwipedUp {
NSLog(@"SW-Up");
}
- (void)screenSwipedDown {
NSLog(@"SW-Down");
}