loosy
loosy

Reputation: 61

Reordering UITableView rows programmatically with animation

I very much know how to reorder UITableView rows using "reorder Control" by the user.

By implementing UITableView delegates and datasource methods as it is provided in apple documentation.

But I want the same functionality programmatically.

I need this in the scenario when a row/cell is updated I want reordering according to that update time or some other criteria.

I've seen this functionality in this grocery list app.

I want reordering with animation.

Upvotes: 5

Views: 2778

Answers (1)

Christian Schnorr
Christian Schnorr

Reputation: 10776

Check out the UITableView reference.

You may want to use these methods:

– beginUpdates
– endUpdates
– insertRowsAtIndexPaths:withRowAnimation:
– deleteRowsAtIndexPaths:withRowAnimation:
– insertSections:withRowAnimation:
– deleteSections:withRowAnimation:

Upvotes: 2

Related Questions