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 7861343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:40:53+00:00 2026-06-02T22:40:53+00:00

I am using UIGestureRecognizer to resign the keyboard when the user taps outside of

  • 0

I am using UIGestureRecognizer to resign the keyboard when the user taps outside of the text fields. This is working with no problem and I have managed to exclude 3 buttons but now that I have added 2 tables into my page, I cannot find a way to exclude them from the shouldReceiveTouch:

This is the relevant code:

- (void)viewDidLoad
{
.....
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
[[self view] addGestureRecognizer:gestureRecognizer];
[gestureRecognizer setDelegate:self];
}

- (void)hideKeyboard
{
[tradeQuantity resignFirstResponder];
[tradeSymbol resignFirstResponder];
[limitPrice resignFirstResponder];
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{        
if (touch.view == placeTradeButton)
{
    return NO;
} else if (touch.view == resetValuesButton)
{
    return NO;
} else if (touch.view == refreshDataButton)
{
    return NO;
} else if (touch.view == secHoldingsTable)
{
    return NO;
} else if (touch.view == tradeTicketsTable)
{
    return NO;
}
return YES;
}

How do I exclude the tables?

  • 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-02T22:41:13+00:00Added an answer on June 2, 2026 at 10:41 pm

    I haven’t found the answer to my question but I did find a workaround that does what I need. Instead of trying to find out how to exclude a table, I did the reverse.

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
    {            
    if (touch.view == [self view])
    {
        return YES;
    }
    return NO;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using UIGestureRecognizer to detect taps or swipes and change page in my
using the jquery ui modal dialog , the background shades grey (i assuming this
Using of mobile dialog authentication is working well for other mobile devices except on
Using Ivy with this Ant target: <target name=retrieve-jars> <ivy:retrieve pattern=WebContent/WEB-INF/lib/[artifact].[ext] /> </target> to fetch
I'm using a custom UIGestureRecognizer subclass to track gestures on my InfoView class. The
I am attempting to get a UIGestureRecognizer working with a UIWebview which is a
Using android 2.3.3, I have a background Service which has a socket connection. There's
I was interested in using a UIGestureRecognizer subclass (UILongPressGestureRecognizer) in a ViewController Subclass I
I had a problem regarding rotation of an image in my code using rotation
Using mercurial, I've run into an odd problem where a line from one committer

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.