1
votes

Basically I have a scrollView, on which there is another view. On that view I also have a UITapGestureRecognizer.

I'm animating scrolling of the scrollView. However, during this scrolling animation, tap gesture recognizer doesn't actually recognize taps.

Any ideas?

2
Show the code of your animation.Nirav D

2 Answers

0
votes

Without code We can't give suggestion but try with below code might be useful for you!

tapGestureRecognizer.numberOfTapsRequired = 1
tapGestureRecognizer.isEnabled = true
tapGestureRecognizer.cancelsTouchesInView = false
0
votes

For best practise, you can use button action instead of UITapGesture by adding UIButton. the reason is simple, to manage the button is far much simple then the UITapGesture but I am not saying use UIButton instead of tap gesture all the time, its all about your requirement.

For your case, add this line

view.userInteractionEnabled = false

and make sure your view is added in the UITapGestureand UITapGesture method is properly implemented in your code work.

For more basic, go with these two tutorials,

First tutorial | Second tutorial

If you still face any problem then let me know.