This is an example of how to use the new
UITableView, which has
UICollectionView requires updates to be stored, and then submitted as a block to
NSFetchedResultsController is designed for use with
UITableView, and as such is tuned for some of it's quirks. Table views allow updates to items within sections that are also being updated.
UICollectionView runs into exceptions if you add items into sections that are being added, delete items from sections that are being deleted, etc. This means that when using
UICollectionView, you need to filter the updates so you do not perform changes within sections that are also changing.
Supported as of iOS 8. When using Swift, you may want to consider using JSQDataSourcesKit or translating this to Swift.
Clone the repo and look in the
UICollectionViewController subclass. The logic inside the
.m file shows how to queue updates.
Section updates are stored in
_sectionChanges while updates to objects within sections are stored in
controllerDidChangeContent: is called, these updates are dequeued, coalesced, and then submitted as a block to the