---
title: numberOfSections
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionview/numberofsections
---

# numberOfSections

The number of sections displayed by the collection view.

## Declaration

```swift
var numberOfSections: Int { get }
```

## See Also

### Getting the state of the collection view

- [numberOfItems(inSection:)](uikit/uicollectionview/numberofitems(insection:).md)
- [visibleCells](uikit/uicollectionview/visiblecells.md)
