I am trying to switch between two different images when clicking on a button. Below is the code I wrote so far. However, this will only display one image and not toggle between them.
-(IBAction)show {
BOOL img = true;
if (img = true) {
UIImage *img1 = [UIImage imageNamed:@"UnCheck.png"];
[imageview setImage:img1];
}
else {
UIImage *img = [UIImage imageNamed:@"Check.png"];
[imageview setImage:img];
}
}