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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:39:37+00:00 2026-06-04T06:39:37+00:00

I have a custom UITableViewCell with a UITapGestureRecognizer on a UILabel which segues to

  • 0

I have a custom UITableViewCell with a UITapGestureRecognizer on a UILabel which segues to a new view controller. When the tap gesture occurs, the segue works, but always passes data from the only first cell, regardless of which cell the tapGesture is performed in. However, when I first select a cell outside of the label tapGestureRecognizer, and then perform the tap gesture, the data passes successfully b/c I first selected the respective cell.

How can I set the tapGesture to also recognize the cell selection?

P.S. I set up the gesture and segue in storyboard, not code. Also, my data passing code is my prepareForSegue method.

  • 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-04T06:39:38+00:00Added an answer on June 4, 2026 at 6:39 am

    You’re question is a bit light on details, but let me ask: are you determining in your code which cell was selected when the tap occurs?

    ie. In your method that fires when a tap occurs, check which cell the tap occurred in by querying the tableview, and from that you can determine which code you need to pass in your prepareForSegue method.

    For example, I use this method below to determine which cell was tapped on, and bring up the keyboard for the textfield of that cell. You can easily adapt this to store away which cell was tapped on, then use it in your prepareForSegue to send the right data.

    Hope this is what you are looking for. Can’t quite tell from your question though!

    - (void) tapDetected:(UIGestureRecognizer*)sender
    {
        // get location of tap
        CGPoint tapLocation = [sender locationInView:self.tableView];
    
        // Query tableview and get location of cell
        NSIndexPath *idp = [self.tableView indexPathForRowAtPoint:tapLocation];
    
        // Now get the actual cell
        UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:idp];
    
        // Get handle on text field
        UITextField *textField = (UITextField *)[cell viewWithTag:1];
    
        // Bring up keyboard for that textfield.
        [textField becomeFirstResponder];
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom UITableViewCell subclass, and a table view controller which I want
I have a custom UITableViewCell which is part of a navigation controller. The cell
I have a custom UITableViewCell that contains a UISlider control and a UILabel which
I have a custom UITableViewCell which contains several UIButtons. Each button's frame position is
I have a custom UITableViewCell which has an image & and some text. When
I have a UISwitch inside a custom UITableViewCell (the subclass of which I call
I have a custom UITableViewCell , which have a button on it, IB linked
I have a custom UITableViewCell which I created in Interface Builder. I am successfully
In my app I have custom UITableViewCell , and I have UIStepper and UILabel
I have a custom UITableViewCell which has some subviews. i.e. some labels, some images.

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.