i have a UIImageView displayed in my view with an image “image1” already set.
I have a button below it.
During runtime i would like the image to change to “image 2” when the button is pressed and upon release i would like the image to display “image1” again
1) I know that i have to give the UIImage a label or something so that i can access it from xcode.
2) i know that i need to change the propery of the image upon press
3) i need to have an IBAction or something so that when i press the button it should change the property of the image to “image2”
BUT i dont know how to do this?
Can someone help please?
You need an outlet in your controller that is connected to the image view, so that the controller can find and message the image view. Check out this tutorial, and the Interface Builder documentation.