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

# preferredContentSize

The preferred size for the view controller’s view.

## Declaration

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

## Discussion

Discussion The value in this property is used primarily when displaying the view controller’s content in a popover but may also be used in other situations. Changing the value of this property while the view controller is being displayed in a popover animates the size change; however, the change is not animated if you specify a width or height of 0.0.

## See Also

### Managing the view

- [view](uikit/uiviewcontroller/view.md)
- [viewIfLoaded](uikit/uiviewcontroller/viewifloaded.md)
- [isViewLoaded](uikit/uiviewcontroller/isviewloaded.md)
- [loadView()](uikit/uiviewcontroller/loadview().md)
- [viewDidLoad()](uikit/uiviewcontroller/viewdidload().md)
- [loadViewIfNeeded()](uikit/uiviewcontroller/loadviewifneeded().md)
- [title](uikit/uiviewcontroller/title.md)
- [ornaments](uikit/uiviewcontroller/ornaments.md)
