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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:40:38+00:00 2026-05-15T19:40:38+00:00

Is there a way to increase the speed that you can drag a cell

  • 0

Is there a way to increase the speed that you can drag a cell up/down during a table’s movable row mode of a UITableView? For instance, there seems to be a standard speed that the table will allow you to drag the cell when you are moving it around and the scroll speed seems to increase if you hold it near the top/bottom edge of the device screen. For a given cell height and a whole bunch of cells, this might take a while to re-order them all if I have to use their standard slow scrolling.

So basically, I would like to increase the speed that it scrolls up/down when you are dragging the cell so it won’t take as long to get to where you want to drop the cell in place.

I understand that you can speed up the moving process by decreasing cell height to place more cells on the device screen, but I’d rather do this only if I can’t increasing scrolling speed.

Any suggestions or ideas from past experiences with this? Any advice is greatly appreciated!

  • 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-15T19:40:39+00:00Added an answer on May 15, 2026 at 7:40 pm

    Here you go. A proof of concept of a speed enhancer of the scroll when you move a cell, SDK 3.1. It may not pass Apple’s requirements since overriding _beginReorderingForCell and _endReorderingForCell looks a little off-spec. There are other ways to determine if a cell starts or ends reordering (e.g. subclassing UITableViewCell and finding some measure) but this is the easiest I think.

    The approach is quite simple: for every movement of Y pixels down, we move 2*Y pixels down, only when reordering.

    The problem is that the currently dragged cell is a subview of the table view, so it shifts with the table view if we move it. If we are to correct for that within this setContentOffset, it has no effect since the position of the cell will be set based on values calculated apart from the current contentOffset. Therefore we correct an instant later using performSelector.

    I left the debugging lines in there for convenience. All you need to do is to use FastUITableView instead of UITableView (esp. in you NIB)

    You may of course want to add some timing things, so that the speed only goes up after 1 second or so. That will be trivial.

    @interface FastUITableView : UITableView
    {
        UITableViewCell *draggingCell;
        CGFloat lastY;
    }
    @end
    
    
    @implementation FastUITableView
    
    -(void)_beginReorderingForCell:(UITableViewCell*)cell
    {
        printf("begin reordering for cell %x\n",cell);
        draggingCell = cell;
        lastY = -1.0f;
        [super _beginReorderingForCell:cell];
    }
    
    -(void)_endReorderingForCell:(UITableViewCell*)cell wasCancelled:(BOOL)cancelled animated:(BOOL)animated
    {
        printf("end reordering for cell %x\n",cell);
        draggingCell = nil;
        [super _endReorderingForCell:cell wasCancelled:cancelled animated:animated];
    }
    
    -(void)setContentOffset:(CGPoint)pt
    {
        if ( !draggingCell )
        {
            [super setContentOffset:pt];
            return;
        }
    
        if ( lastY < 0 ) lastY = pt.y;
        CGPoint fast = pt;
        float diff = pt.y - lastY;
        //diff *= 0.5; /// <<--- control speed here
        fast.y = pt.y + diff;
    
        if ( fast.y > self.contentSize.height - self.superview.frame.size.height )
        {
            CGFloat corr = fast.y - self.contentSize.height + self.superview.frame.size.height;
            printf("Correction: %f\n",corr);
            fast.y -= corr;
            diff -= corr;
        } else if ( fast.y < 0.0f ) {
            CGFloat corr = -fast.y;
            printf("Correction: %f\n",corr);
            diff += corr;
            fast.y += corr;
        }
    
        [self performSelector:@selector(moveCell:) withObject:[NSNumber numberWithFloat:diff] afterDelay:0.01];
    
        lastY = fast.y;
    
    //  printf("setting content offset: %f -> %f of max %f\n",pt.y, fast.y, self.contentSize.height);
        [super setContentOffset:fast];
    }
    
    -(void)moveCell:(NSNumber*)diff
    {
        CGRect frame = draggingCell.frame;
        frame.origin.y += [diff floatValue];
    //  printf("shifting cell %x with %f\n",draggingCell,[diff floatValue]);
        draggingCell.frame = frame;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to increase the maximum time that a plugin can execute
Is there any way by which I can increase the default width of the
Is there any way to increase the number of items in the iphone tab
Is there any way to change(increase) the data type of a column while saving
Is there a simple way to increase the spacing between the menu item text
Is there way to get file from windows xp command prompt? I tried to
Is there way to automatically maximize the output window on hitting build and then
Is there way to copy a file into Plone with WebDAV and have Plone
is there way how to get name ov event from Lambda expression like with
Is there way to better identify design pattern in source codes, esp. if you

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.