0

is it possible to have a UISwipeGestureRecognizer work in a UIScrollView?

I have some UIImageViews that I move with a swipe up or down, but this all needs to be inside a UIScrollView as the content is larger than the window size. So when I try to swipe the UIImageView the whole screen scrolls.  

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
user551353
  • 79
  • 1
  • 6

2 Answers2

0

This is the solution that worked for me

[[scrollView panGestureRecognizer] requireGestureRecognizerToFail:yourSwipeGestureRecognizer];

although it only works in ios 5.0 and above.

taskinoor
  • 45,586
  • 12
  • 116
  • 142
user551353
  • 79
  • 1
  • 6
0

You could set the minimumTouches property of the recognizer to be 2 or some other number. I'm not sure of just doing it with one is possible.

Letrstotheprez
  • 622
  • 1
  • 5
  • 11