---
title: maxNumberOfColumns
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nscollectionview/maxnumberofcolumns
---

# maxNumberOfColumns

The maximum number of columns that the collection view displays.

## Declaration

```swift
var maxNumberOfColumns: Int { get set }
```

## Discussion

Discussion When the value of this property is 0, the collection view has no maximum number of columns. The default value of this property is 0. It is possible for a collection view to specify both a maximum number of rows and a maximum number of columns. If the number of content objects exceeds the number of displayable items (n=maxNumberOfRows * maxNumberOfColumns) only the first n items of the content array are displayed.

## See Also

### Legacy Collection View Support

- [itemPrototype](appkit/nscollectionview/itemprototype.md)
- [newItem(forRepresentedObject:)](appkit/nscollectionview/newitem(forrepresentedobject:).md)
- [selectionIndexes](appkit/nscollectionview/selectionindexes.md)
- [maxNumberOfRows](appkit/nscollectionview/maxnumberofrows.md)
- [minItemSize](appkit/nscollectionview/minitemsize.md)
- [maxItemSize](appkit/nscollectionview/maxitemsize.md)
- [item(at:)](appkit/nscollectionview/item(at:)-80xze.md)
- [frameForItem(at:)](appkit/nscollectionview/frameforitem(at:).md)
- [frameForItem(at:withNumberOfItems:)](appkit/nscollectionview/frameforitem(at:withnumberofitems:).md)
- [draggingImageForItems(at:with:offset:)](appkit/nscollectionview/draggingimageforitems(at:with:offset:)-951w7.md)
- [setDraggingSourceOperationMask(_:forLocal:)](appkit/nscollectionview/setdraggingsourceoperationmask(_:forlocal:).md)
