is there any way to hide an UIButton until the UIImageView is pressed??
When the picture is pressed I need to show the back Button, like it works at the Photo App on the iPhone???
Here is the code of my UIButton:
- (void)viewDidLoad {
[super viewDidLoad];
[self ladeImage];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(10, 10, 40, 40);
[btn addTarget:self action:@selector(goToViewA) forControlEvents:UIControlEventTouchUpInside];
[btn setTitle:@"<<" forState:UIControlStateNormal];
[self.view addSubview:btn];
}
First step :
btn.hidden = YESThen you have to subclass the UIImageView to react to its
touchesEnded:event and change the hidden property of your button there. For that, the proper way is to create a protocol (with a viewTouched method). Implement that protocol in the viewController containing your button and you ImageView. Add a delegate propery to the subclassed ImageView (i.e.id<MyCustomProtocol> _delagate;) and assign the view controller to this propery.