this is my first time asking for some help here although I’ve been lurking on this forum for the past 6 months. so here a simple one and I know its been asked like many times before but none of them comes with a simple answer that really helped. hope that maybe someone here who kindly enough can help me and many others that need this with a helpful tips.
so this is what I already did to hide the outlets :
in the header file :
@interface tapgestureViewController : UIViewController {
IBOutlet UIButton *btn1;
IBOutlet UIButton *btn2;
IBOutlet UITextView *text;
}
-(IBAction)hideOutlets;
@end
and on the implementation file :
-(IBAction)hideOutlets:(UITapGestureRecognizer*)singleTap {
btn1.hidden = YES;
btn2.hidden = YES;
text.hidden = YES;
}
my simple question is : how to unhide/show the outlets again if the user tap again on the screen?
I think that the simplest way to accomplish this is by using:
This will simply negate your current bool state and you’re done 🙂
EDIT:
To check if the touch was somewhere on the form but not on the buttons or text field try using this. It should work. No need to use the
UITapGestureRecognizeranymore.