<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIContentContainer/preferredContentSizeDidChange(forChildContentContainer:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIContentContainer(im)preferredContentSizeDidChangeForChildContentContainer:"
  },
  "title" : "preferredContentSizeDidChange(forChildContentContainer:)"
}
-->

# preferredContentSizeDidChange(forChildContentContainer:)

Notifies an interested controller that the preferred content size of one of its children changed.

```
func preferredContentSizeDidChange(forChildContentContainer container: any UIContentContainer)
```

## Parameters

`container`

The child view controller whose preferred content size has changed.

## Discussion

UIKit calls this method on a container view controller when the [`preferredContentSize`](/documentation/UIKit/UIContentContainer/preferredContentSize) property of one of its child view controllers changes. Similarly, if the view controller is managed by a presentation controller, UIKit calls this method on the presentation controller to let it know of the change. The parent view controller or presentation controller can use this method to initiate layout adjustments based on the new size information.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)