我正在使用交换手势,它在视图(Ex 类 A)中工作正常,但它在另一个视图控制器(Ex - B 类,C)中调用。我没有使用 navigationController 只是 addView on view .. 代码 -
swipeLeftRecognizer = nil;
swipeLeftRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
swipeLeftRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
swipeLeftRecognizer.numberOfTouchesRequired = 1;
swipeLeftRecognizer.delegate = self;
swipeLeftRecognizer.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:swipeLeftRecognizer];
swipeRightRecognizer = nil;
swipeRightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
swipeRightRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
swipeRightRecognizer.numberOfTouchesRequired = 1;
swipeRightRecognizer.delegate = self;
swipeRightRecognizer.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:swipeRightRecognizer];
因此,我无法在另一个视图(B,C)中提供 Button 的操作。请告诉我任何解决方案。