UITableViewRowAnimation as a block (instead of a row) animation

Is there anyway to make a UITableViewRowAnimation animate at the same time?

Such as, If I'm adding 4 rows to a TableView, animate the block of 4 rows rather than animating both row individually?

Snippet, tutorial for custom animation etc are welcome !

Answers


There are several ways as described in the docs:

Batch Insertion, Deletion, and Reloading of Rows and Sections

The UITableView class allows you to insert, delete, and reload a group of rows or sections at one time, animating the operations simultaneously in specified ways. The eight methods shown in Listing 7-7 pertain to batch insertion and deletion. Note that you can call these insertion and deletion methods outside of an animation block (as you do in the data source method tableView:commitEditingStyle:forRowAtIndexPath: as discussed in “Inserting and Deleting Rows in Editing Mode”).

Listing 7-7 Batch insertion and deletion methods

- (void)beginUpdates;
- (void)endUpdates;

- (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation;
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation;
- (void)reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation;

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation;
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation;
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;

Need Your Help

how to mock jquery calls from within a function using jasmine and sinon

jquery backbone.js jasmine sinon

First, this is a job requirement. If it can't be done this way I need a good argument to give.

How to assign the url that's being scraped from to an item?

python scrapy

I'm pretty new to Python and Scrapy and this site has been an invaluable resource so far for my project, but now I'm stuck on a problem that seems like it'd be pretty simple. I'm probably thinking ...

how to contruct HttpSendRequest method of WININET

visual-c++ wininet

I have dummy web service with URI =http://localhost/IO_100_Service.svc/xml?id={id} which return data in XML format

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.