Reputation: 43
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?
Upvotes: 0
Views: 1322
Reputation: 7602
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 returnYES
. 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.
Upvotes: 2