Quote:
Originally Posted by kieran12
Hey everyone. I have a UIImageView that I want to receieve an action. I want it to act like a button. It will not have an image set so it will be invisible, then when tapped i want it to change to an image.
I know that IBActions do not work on a UIImageView. How could I achieve this?
P.S I don't want to set the image property of a button it must be a UIImageView.
|
The default value for the userInteractionEnabled property of a UIImageView is NO. To make a UIImageView accept actions, you need to set the value of the property to YES.
Code:
[myUIImageView setUserInteractionEnabled:YES];