I'm very new to programming, so I'm having some issues trying to do this. I have an app that displays an image in a UIImageView, and I would like for the image to enlarge when the user taps on it. I figured that the easiest way to do this would be to hide a translucent button over the UIImageView, and fire off an action when the user taps it. That is about as far as I can get, I have no idea what my action method should look like. This is what I have so far:
- (IBAction)enlargeImage1:(id)sender {
CGRect myImageRect = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 80.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:@"gradient-253x80.png"]];
[self.view addSubview:myImage];
}
My UIImageView is named imageView, and I attached the above method to the UIButton that is over imageView. When I click on the image, it does not enlarge at all. Any help or advice is much appreciated, thank you!