Collection View

Display one or more subviews in a highly configurable arrangement.

Topics

View

class NSCollectionView

An ordered collection of data items displayed in a customizable layout.

protocol NSCollectionViewSectionHeaderView

A protocol that defines a button to control the collapse of a collection view’s section.

Data

protocol NSCollectionViewDataSource

A set of methods that a data source object implements to provide the information and view objects that a collection view requires to present content.

protocol NSCollectionViewDelegate

A set of methods that you use to manage the behavior of a collection view.

Items

class NSCollectionViewItem

The visual representation for a single data element in a collection view.

protocol NSCollectionViewElement

A set of methods that you use to manage the content in a collection view.

Layouts

Using Collection View Compositional Layouts and Diffable Data Sources

Bring complex, high-performance layouts to your app, and simplify updating and managing your user interface.

class NSCollectionViewFlowLayout

A layout that organizes items into a flexible and configurable arrangement.

protocol NSCollectionViewDelegateFlowLayout

A set of methods that a delegate implements to provide layout information to a flow layout object in a collection view.

class NSCollectionViewGridLayout

A layout that displays a single section of items in a row and column grid.

class NSCollectionViewTransitionLayout

An object that implements custom behaviors when changing from one layout to another in a collection view.

class NSCollectionViewLayoutAttributes

An object that contains layout-related attributes for an element in a collection view.

class NSCollectionViewLayout

An abstract base class that you subclass and use to generate layout information for a collection view.

class NSCollectionViewCompositionalLayout

A layout object that lets you combine items in highly adaptive and flexible visual arrangements.

class NSCollectionViewCompositionalLayoutConfiguration

An object that defines scroll direction, section spacing, and headers or footers for the layout.

typealias NSCollectionViewCompositionalLayoutSectionProvider

A closure that creates and returns each of the layout's sections.

enum NSCollectionLayoutSectionOrthogonalScrollingBehavior

The scrolling behavior of the layout's sections in relation to the main layout axis.

Updates

class NSCollectionViewUpdateItem

A description of a single change to make to an item in a collection view.

class NSCollectionViewLayoutInvalidationContext

An object that identifies the portions of your layout that need to be updated.

class NSCollectionViewFlowLayoutInvalidationContext

An object that identifies the portions of a flow layout object that need to be updated.

See Also

Content Views

Browser View

Provide a column-based interface for viewing and navigating hierarchical information.

Outline View

Display a list-based interface for hierarchical data, where each level of hierarchy is indented from the previous one.

Table View

Display custom data in rows and columns.

class NSTextView

A view that draws text and handles user interactions with that text.

class NSOpenGLView

A view that displays OpenGL content in a view.

Deprecated