我希望向 UITableView 添加一个手势识别器,它使用两个手指向上或向下,就像 Twitterific 用于切换状态栏一样。
这是我的代码
[self.tableView setMultipleTouchEnabled:YES];
[self.tableView.panGestureRecognizer setMaximumNumberOfTouches:1];
UISwipeGestureRecognizer *swipeUpGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doubleSwipeUp)];
[swipeUpGesture setNumberOfTouchesRequired:2];
[swipeUpGesture setDirection:UISwipeGestureRecognizerDirectionUp];
[swipeUpGesture setDelaysTouchesBegan:YES];
[self.tableView addGestureRecognizer:swipeUpGesture];
UISwipeGestureRecognizer *swipeDownGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doubleSwipeDown)];
[swipeDownGesture setNumberOfTouchesRequired:2];
[swipeDownGesture setDirection:UISwipeGestureRecognizerDirectionDown];
[swipeUpGesture setDelaysTouchesBegan:YES];
[self.tableView addGestureRecognizer:swipeDownGesture];
我在 viewDidLoad 中调用它并且没有调用 doubleSwipeUp。
我能做些什么?