我在viewDidLoad方法中使用以下代码。
TextBox
我希望用户来回扫描图像。但是没有调用swipeLeft和swipeRight方法。为什么会这样?
答案 0 :(得分:1)
设置委托<UIGestureRecognizerDelegate>
并添加以下代码
swipeLeft.delegate = self;
swipeRight.delegate = self;
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
return YES;
}