---
title: collectionViewContentSize
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionviewlayout/collectionviewcontentsize
---

# collectionViewContentSize

The width and height of the collection view’s contents.

## Declaration

```swift
var collectionViewContentSize: CGSize { get }
```

## Return Value

Return Value The width and height of the collection view’s contents.

## Discussion

Discussion Subclasses must override this property and use it to return the width and height of the collection view’s content. These values represent the width and height of all the content, not just the content that is currently visible. The collection view uses this information to configure its own content size for scrolling purposes. The default implementation of this method returns CGSizeZero.

## See Also

### Getting the collection view information

- [collectionView](uikit/uicollectionviewlayout/collectionview.md)
