NSCollection protocol defines the methods for managing content in a collection view. Adopt this protocol in the classes that you use to display content for items, supplementary views, and decoration views in a collection view. The methods of this protocol are optional and provide support for applying layout attributes and for cleaning up elements when they move offscreen and are recycled.
- macOS 10.11+
Collection view items—that is, instances of the
NSCollection class—already adopt this protocol. For supplementary and decoration views, adopt this protocol in the custom view classes you use to represent that content.