Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't my UIImageView respond to taps?

I have a UIImageView that's being loaded from a NIB. I've hooked up a gesture recognizer to it to handle taps, but when I run the app, taps aren't being detected.

like image 438
Don McCaughey Avatar asked Jul 22 '10 16:07

Don McCaughey


1 Answers

You need to set the userInteractionEnabled property to YES. It's NO by default. You can either set it in the NIB by checking "User Interaction Enabled" in the Attributes Inspector pane, or set it programmatically after the NIB is loaded by setting the userInteractionEnabled property on the UIImageView.

like image 52
Don McCaughey Avatar answered Oct 09 '22 13:10

Don McCaughey