我无法找到有关如何正确设置iOS手势识别器的教程。
我需要检测刷对他们的回调。
我需要检测刷对他们的回调。
任何帮助,赞赏。谢谢。
你需要两个识别器,一个用于滑动,另一个用于扫描:
- UISwipeGestureRecognizer* swipeUpGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeUpFrom:)];
- swipeUpGestureRecognizer.direction = UISwipeGestureRecognizerDirectionUp;
对于处理程序:
- - (void)handleSwipeUpFrom:(UIGestureRecognizer*)recognizer {
- }
最后,您将其添加到您的视图中:
- [view addGestureRecognizer:swipeUpGestureRecognizer];
对于另一个方向(只是将所有的上升到Downs)相同。