TheNounProject / CollectionView

An easy to use, highly customizable replacement for NSCollectionView.
MIT License
121 stars 16 forks source link

Reloading Items & Sections, open proxy, and context observer #14

Closed WCByrne closed 6 years ago

WCByrne commented 6 years ago

Reloading

reloadItems(_:) would be ignored if no other changes were made in the same editing session. That has been fixed and items will now reload.

Adds reloadSections(_:) to drop and replace all items in a section.

CollectionViewProxy

The proxy object is useful to translating changes in a data set (in particular a results controller) to collection view edits. The class is now more public/open to make it possible to create custom handling when transferring these edits to a collection view.

Context Observer

While FetchedResultsController is great at managing changes to objects, some data sets may be a combination of properties from multiple objects. FetchedSetController is an example of this and is useful when the order and organization of objects is unimportant. ContextObserver now provides a base for this type of functionality, ready to expend as needed.

An example is a TagController for managing shared tags from a set of objects. The ContextObserver subclass can watch for changes from a set of objects with a tags and handle the changes as needed without the unnecessary organizational overhead of a ResultsController.