Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You want to move and shuffle cells and sections inside a table view, with smooth and intuitive animations.
Use the moveSection:toSection: method of the table
view to move a section to a new position. You can also use the
moveRowAtIndexPath:toIndexPath: method to
move a table view cell from its current place to a new place.
Moving table view cells and sections differs from exchanging them. Let’s have a look at an example that will make this easier to understand. Let’s say you have three sections in your table view: Sections A, B, and C. If you move Section A to Section C, the table view will notice this move and will then shift Section B to the previous position of Section A, and will move Section B to the previous position of Section B. However, if Section B is moved to Section C, the table view will not have to move Section A at all, as it is sitting on top and doesn’t interfere with the repositioning of Section B and C. In this case, Section B will be moved to Section C and Sec....