---
title: preferredContentSize
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicontentcontainer/preferredcontentsize
---

# preferredContentSize

The preferred size for the container’s content.

## Declaration

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

## Discussion

Discussion The UIViewController class implements a writable version of this property.

## See Also

### Responding to changes in child view controllers

- [size(forChildContentContainer:withParentContainerSize:)](uikit/uicontentcontainer/size(forchildcontentcontainer:withparentcontainersize:).md)
- [preferredContentSizeDidChange(forChildContentContainer:)](uikit/uicontentcontainer/preferredcontentsizedidchange(forchildcontentcontainer:).md)
- [systemLayoutFittingSizeDidChange(forChildContentContainer:)](uikit/uicontentcontainer/systemlayoutfittingsizedidchange(forchildcontentcontainer:).md)
