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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:06:15+00:00 2026-06-17T04:06:15+00:00

I’ve got a UITableView on which I’m toggling setEditing:animated: on, to allow the user

  • 0

I’ve got a UITableView on which I’m toggling setEditing:animated: on, to allow the user to insert and delete rows. When editing is turned on, I want a new insert new item row to be added to the table and then I want the editing controls to animate in like normal. I don’t want the new insert new item row to animate in on its own, using something like a fade. I want it to just appear, and then slide in like any existing table data source rows do.

Here’s what is happening as a result of my current code, though (click for larger view):



The top row does what I want – it simply slides over and the delete icon fades in. When it disappears, the delete icon fades out and the row expands again.

The second row is my non-data-source row that I add to the table myself. On appearing, it does not animate in at all. The insert icon and row appear all at once and do not slide in. When it disappear, the row expands nicely, but the plus icon slides with it. The animation is occurring for the entire row, and not for the plus icon and then row separately, like the first row.

Here’s a quick run-down of my code, but I think providing a link to the class file might be better.

When an edit button on my toolbar is pressed, I call my UIViewController method setEditing:animated:. In this method, I do the following …

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {

    [super setEditing:editing animated:animated];

    // keep the table in the same editing mode
    [_table setEditing:editing animated:animated];

    if (editing) {

        [_table insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_channels.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone];

    } else {

        [_table deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_channels.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone];

    }

}

This is where the animations of the inserting is occuring. I’ve tried wrapping the whole thing in [_table beginUpdate] and endUpdate, as well as just the row insertion. Neither seems to produce the clean animation I’m aiming for.

Any ideas what I might be missing? The whole code file is here:

https://github.com/ryancole/pound-client/blob/master/pound-client/controllers/ChannelListViewController.m#L106-L127

  • 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-17T04:06:16+00:00Added an answer on June 17, 2026 at 4:06 am

    The super call does the sliding ‘to editing’ animation so if you insert something after it, it won’t take part in it. What you want to do is insert the row before that call and remove the row after. You’ll also need to keep track of the rows with a different boolean.

    - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    
        _amEditing = editing;
    
        if (editing) {
    
            [_table insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_channels.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
    
        } 
    
        [super setEditing:editing animated:animated];
    
        // keep the table in the same editing mode
        [self.view setEditing:editing animated:animated];
    
        if (!editing)
        {
            [_table deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_channels.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
        }
    
    
    }
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        return _amEditing ? _channels.count + 1 : _channels.count;
    }
    

    UPDATE:

    The second to last row’s icon still has a strange animation.. to work around this you can add a delay to the deletion..

        if (!editing)
        {
            [self performSelector:@selector(deleteLastRow) withObject:nil afterDelay:0.25];
        }
    
    -(void) deleteLastRow
    {
        [self.view deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_objects.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to parse a xhtml file and display in UITableView. what is the
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm interested in microtypography issues on the web. I want a tool to fix:

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.