Mandeep Kaur
Mandeep Kaur

Reputation: 183

Touch events does not fired when UIScrollViewer.userinteractionenabled=true

In my app there is UIScrollViewer(uiimageview inside this), when the userinteractionenabled=true, then no touch event fires in the app. How can i enable the touch events with userinteractionenabled=true.

I have tried using UITapGestureRecognizer, it works fine. But normally I am attaching an event to a button inside the touchesBegan event, as now i have applied the UITapGestureRecognizer, then in this I just do the things that needs to be done in touchesBegan event, but now click event of a button does not fire. I need to get these events in my app.

Please help me!

Upvotes: 0

Views: 428

Answers (2)

Padavan
Padavan

Reputation: 1074

Maube you need tabContent.multipleTouchEnabled = YES?

Upvotes: 0

Vignesh
Vignesh

Reputation: 10251

Since your image view is on top of scrollview touchesBegan will not have the desired effect. The scrollview swallows all touches. It has nothing to do with userinteractionenabled.

To make the subview of scrollview to get touch you will have to pass touch yourself. Have a Look at this answer.

Upvotes: 1

Related Questions