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

  • Home
  • SEARCH
  • 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 7725875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:03:40+00:00 2026-06-01T05:03:40+00:00

I have my table view and the cells within it have the UILongPressGestureRecognizer added

  • 0

I have my table view and the cells within it have the UILongPressGestureRecognizer added to them. The issue is that once a cell it touched it gets highlighted, but once my long gesture starts (holding the button) the highlighting goes away. The gesture works and its still being held but its a little confusing to the user because they dont know if its still being held. How can I make the cell stay highlighted throughout the hold.

some code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) 
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

        //add long press gesture for the audio AB (eventually VC and TP as well) list 
        //so that users can hold the cell and after 5 seconds have the dialpad for editing that entry
        UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
                                                    initWithTarget:self 
                                                    action:@selector(handleLongPress:)];
        longPress.minimumPressDuration = 1; 
        [cell addGestureRecognizer:longPress];

    }
    cell.textLabel.text = [self.tableArray objectAtIndex:indexPath.row];



    return cell;
}


- (void)handleLongPress:(UILongPressGestureRecognizer*)sender 
{ 
    //used to get indexPath of cell pressed
    UITableViewCell *cell = (UITableViewCell *)[sender view];

    //get the indexPath of cell pressed
    NSIndexPath *indexPath = [self.myTableView indexPathForCell:cell]; 

    //use the index press to figure out the proper join to hold
    self.sharedJoinNumber = indexPath.row+286 ;

}
  • 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-01T05:03:42+00:00Added an answer on June 1, 2026 at 5:03 am

    I did get this problem fixed by using

     //highlight the apprioriate cell
        [self.myTableView selectRowAtIndexPath:indexPath animated:FALSE scrollPosition:UITableViewScrollPositionNone];
    

    right after - (void)handleLongPress:(UILongPressGestureRecognizer*)sender

    however now if the hold is canceled the next cell clicked needs to be double taped to be highlighted. Basically the next tap after the longpress is cancelled doesnt get noticed. but i think this is a separate questing which i will file accordingly. the above code does fix my problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table view controller with custom cells. In those cells i added
On each cell of my table view I want to have a bar that
I have one table view within the app that I hope multiple parts of
I have a custom cell that contains a button in a table view. The
I've got a custom table view cell defined within a nib, I'm finding that
I have a Table View Controller with cells. I want to update the text
I'm missing something fundamental here. I have a table view with each cell displaying
My app needs to have variable height table cells (as in each table cell
I have a UITableView with a Left Detail styled cell. The table view is
In my app I have a table view with 12 types of custom cells.

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.