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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:07:57+00:00 2026-05-24T23:07:57+00:00

I have a UITapGestureRecognizer in a custom table cell which is intended to do

  • 0

I have a UITapGestureRecognizer in a custom table cell which is intended to do nothing (remove the ability to tap on a cell to select it). This works great however there are some buttons (subviews) in the cell which cannot be tapped because the tap gesture handles that whole cell area.

So its as simple as detecting when the touch gesture is over one of those buttons and returning false to cancel that particular gesture, right? Well not for me …

I have removed the logic and simply returned NO in the gesture recogniser, but I still can’t tap the buttons.

- (BOOL)ignoreTap:(UIGestureRecognizer*)gestureRecognizer shouldReceiveTouch:(UITouch*)touch
{
    return NO;
}

Is there something I am missing here?

  • 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-05-24T23:07:58+00:00Added an answer on May 24, 2026 at 11:07 pm

    The solution is more simple: you shouldn’t be using a gesture recognizer to do this. If you don’t want a cell to be selectable, you can do two things:

    • return nil from -tableView:willSelectRowAtIndexPath: to make it unselectable
    • set the cell’s selectionStyle to UITableViewCellSelectionStyleNone to remove the highlight effect

    Doing it this way should preserve your button functionality.


    Edit: if you don’t want to do that, then you can do what you were originally trying — except I think you have the method name wrong, it should be this:

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have this in my code tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(updateLeftLabel:)]; which
I have a custom UIView , to which I have added a UITapGestureRecognizer to
I have this in my table header view section: UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self
I have a UITapGestureRecognizer which basically performs an action to add a subview. When
I have a UIView in which I added a UITapGestureRecognizer . Inside that view
I have a UIWebView in which it has a UITapGestureRecognizer and basically in my
Currently I have in my code tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(addCompoundToLabel:)]; My code
I have set up a gesture recognizer for my table cell in my IOS5
I have a UITableView which I present in a UIPopoverController . The table view
I have 5 UIImageView and one UITapGestureRecognizer, but when I tap on my UIImageView

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.