Programmatically change UIImageView by displaying image1 to image2

UIImageView is placed in the interface constructor. I have already created IBOutlet. How to programmatically change UIImageView to view another image.

Can anyone help me out?

+5
source share
1 answer

If myImageView is your outlet, then in the code you can use:

myImageView.image = [UIImage imageNamed: @"myNewImage.png"];
+8
source

All Articles