0

I have a uiView with added TapGestureRecognizer. This view is showed in scroll view. If the view is visible on the start, when ViewController with scroll view show, everythink is OK. Problem occurs when the view is not visible on start (when I need scroll ScrollView to see it) then TapGestureRecognizer doesn't call Tap action. Did you know how to resolve this problem?

kamil b
  • 43
  • 1
  • 6

1 Answers1

2

As said by wain

The scroll view also has a gesture recogniser. By default, only 1 gesture recognizer can be handling touches at any one time. You need to make yourself the delegate of your gesture and then implement gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: to return YES. This will allow it to work at the same time as the scroll view.

For more detail check Apple's Document link

UIGestureRecognizerDelegate_Protocol

and you can also take reference as Example from below link.

Simultaneous gesture recognizers in Iphone SDK

I hope it will be helpful for you.

Community
  • 1
  • 1
Badal Shah
  • 7,541
  • 2
  • 30
  • 65
  • Thanks for reply but I think this solution not resolve my problem because TapGestureRecognizer work but only if the uiView is visible on start, without scrolling. Problem occurse when is out of first visable content of scrolling view. – kamil b Jan 26 '16 at 10:51
  • Give some more detail in your question. Check you size of UIview and other subviews. – Badal Shah Jan 26 '16 at 10:52