Using GestureRecognizer in ImageView in Scrolling

I have a horizontal scroll view that contains several view controllers, each of which contains a UIImageView. Inside each view controller, I add the resulting GestureRecognizer tool to ImageView so that I can perform a specific action when the image is tapped / double-tapped.

However, ImageView image gesture remodelers do not seem to be shooting, so selectors are not called.

I guess this might have something to do with Imageview hosted in scrollview, but I'm not sure where to start. Is there anything specific I need to do to make sure that the gesture recognizer is called for each scroll image?

Thanks for your suggestions.

+4
source share
1 answer

Your UIImageView may not be configured for user interaction

UIImageView has by default userInteractionEnabled set to NO. I will try to change it to YES.

UIgestureRecognizer in view inside UIScrollView

+8
source

Source: https://habr.com/ru/post/1343875/


All Articles