Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7859651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:58:19+00:00 2026-06-02T21:58:19+00:00

this is my first time asking for some help here although I’ve been lurking

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:58:21+00:00Added an answer on June 2, 2026 at 9:58 pm

    I think that the simplest way to accomplish this is by using:

    -(IBAction)hideOutlets:(UITapGestureRecognizer*)singleTap 
    {
        btn1.hidden = !btn1.hidden;
        btn2.hidden = !btn2.hidden;
        text.hidden = !text.hidden;
    }
    

    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.

    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    {
        UITouch *touch = [touches anyObject];
        CGPoint loc = [touch locationInView:[touch view]];
        if (!(CGRectContainsPoint(btn1.frame, loc) || CGRectContainsPoint(btn2.frame, loc) || CGRectContainsPoint(text.frame, loc)))
        {
            btn1.hidden = !btn1.hidden;
            btn2.hidden = !btn2.hidden;
            text.hidden = !text.hidden;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been asking questions on here for some time, but this will be my
For the first time, I am asking a little bit of help over here
this is my first time asking a question here so apologies if I am
This is the first time i'm asking a question here at stack overflow so
this is my first time posting here, I have a question which I have
This is my first time here so I hope I post this question at
This is my first time on this site and I appreciate any help on
it's i first time i'm asking here. Sorry if the answer is available already.
This is my first time asking my question at stackoverflow. I'm working on a
This is my first time asking a question in this website so please bear

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.