Reputation: 4728
How can I hide a UIButton
on the tap of another button, or any other event?
Upvotes: 12
Views: 29970
Reputation: 34296
Do this in your other button's tap action:
yourButton.hidden = YES;
Upvotes: 0
Reputation: 287
-(IBAction)hideButton
{
yourbutton.hidden = YES;
}
That should do it.
Upvotes: 0
Reputation: 1631
Create an outlet for the button to hide and connect it in your xib:
IBOutlet UIButton *myButton;
Now create an IBAction
for the other button and connect it in the xib:
-(IBAction)hideButton
{
myButton.hidden = YES;
}
So now when you click on the second button, it will hide myButton
.
Upvotes: 21