无法滑动图像

时间:2016-07-18 09:24:59

标签: ios objective-c

我在viewDidLoad方法中使用以下代码。

TextBox

我希望用户来回扫描图像。但是没有调用swipeLeft和swipeRight方法。为什么会这样?

1 个答案:

答案 0 :(得分:1)

设置委托<UIGestureRecognizerDelegate>并添加以下代码

swipeLeft.delegate = self;
swipeRight.delegate = self; 

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{ 
      return YES; 
}