An object that displays a single section of items in a row and column grid layout.
- macOS 10.11+
NSCollection object provides the same layout behavior offered by the
NSCollection class prior to macOS 10.11, and you can use it in cases where you want to maintain the old appearance while still taking advantage of newer collection view features.
Configuring a Collection View to Use a Grid Layout
You can configure a collection view to use a grid layout object programmatically or at design time:
At design time, set the Layout attribute of your collection view to Grid.
NSCollectionobject programmatically and assign it to the collection view’s
View Grid Layout
A grid layout displays only items and does not display supplementary views or decoration views. Use the properties of this class to configure the number of rows and columns in the grid. You can also use these properties to configure the spacing between items and the minimum sizes.