This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Description
UITableView and UICollectionView allow you to make changes in any order during batch updates. When endUpdates is called, the changes are sorted and applied in a safe order. The ASDK versions don't, so if your changes (say, from an NSFetchedResultsController) aren't submitted in a specific order, you'll get an index-out-of-bounds crash sooner or later.
Here's the order changes must be applied in, so we should update ASDataController to accommodate this:
- Updated/reloaded items
- Deleted items, descending order
- Deleted sections, descending order
- Inserted sections, ascending order
- Inserted items, ascending order
EDIT: Oh and moves are tricky. Best bet is to break them up into delete/insert, because the fromIndexPath is pre-update while the toIndexPath is post-update. So tell the UITableView about the move whenever you want, but update the array by breaking the move into two operations that'll get sorted separately.