---
title: UIContentContainer
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uicontentcontainer
---

# UIContentContainer

A set of methods for adapting the contents of your view controllers to size and trait changes.

## Declaration

```swift
@MainActor protocol UIContentContainer : NSObjectProtocol
```

## Overview

Overview The methods of this protocol handle size-related transitions that are related to changes in the current trait environment or view controller hierarchy. When the parent view controller changes, or when trait changes occur that affect the size of a view controller, UIKit calls these methods to give the affected objects a chance to respond appropriately. All UIViewController and UIPresentationController objects provide default implementations for the methods of this protocol. When creating your own custom view controller or presentation controller, you can override the default implementations to make adjustments to your content. For example, you might use these methods to adjust the size or position of any child view controllers. When overriding the methods of this protocol, call super to let UIKit perform any default behaviors. View controllers and presentation controllers perform their own adjustments when these methods are called. Calling super ensures that UIKit is able to continue adjusting other parts of your user interface.

## Topics

### Responding to environment changes

- [viewWillTransition(to:with:)](uikit/uicontentcontainer/viewwilltransition(to:with:).md)
- [willTransition(to:with:)](uikit/uicontentcontainer/willtransition(to:with:).md)

### 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)
- [preferredContentSize](uikit/uicontentcontainer/preferredcontentsize.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [UIActivityViewController](uikit/uiactivityviewcontroller.md)
- [UIAlertController](uikit/uialertcontroller.md)
- [UICloudSharingController](uikit/uicloudsharingcontroller.md)
- [UICollectionViewController](uikit/uicollectionviewcontroller.md)
- [UIColorPickerViewController](uikit/uicolorpickerviewcontroller.md)
- [UIDocumentBrowserViewController](uikit/uidocumentbrowserviewcontroller.md)
- [UIDocumentMenuViewController](uikit/uidocumentmenuviewcontroller.md)
- [UIDocumentPickerExtensionViewController](uikit/uidocumentpickerextensionviewcontroller.md)
- [UIDocumentPickerViewController](uikit/uidocumentpickerviewcontroller.md)
- [UIDocumentViewController](uikit/uidocumentviewcontroller.md)
- [UIFontPickerViewController](uikit/uifontpickerviewcontroller.md)
- [UIImagePickerController](uikit/uiimagepickercontroller.md)
- [UIInputViewController](uikit/uiinputviewcontroller.md)
- [UINavigationController](uikit/uinavigationcontroller.md)
- [UIPageViewController](uikit/uipageviewcontroller.md)
- [UIPopoverPresentationController](uikit/uipopoverpresentationcontroller.md)
- [UIPresentationController](uikit/uipresentationcontroller.md)
- [UIReferenceLibraryViewController](uikit/uireferencelibraryviewcontroller.md)
- [UISearchContainerViewController](uikit/uisearchcontainerviewcontroller.md)
- [UISearchController](uikit/uisearchcontroller.md)
- [UISheetPresentationController](uikit/uisheetpresentationcontroller.md)
- [UISplitViewController](uikit/uisplitviewcontroller.md)
- [UITabBarController](uikit/uitabbarcontroller.md)
- [UITableViewController](uikit/uitableviewcontroller.md)
- [UITextFormattingViewController](uikit/uitextformattingviewcontroller.md)
- [UIVideoEditorController](uikit/uivideoeditorcontroller.md)
- [UIViewController](uikit/uiviewcontroller.md)

## See Also

### Content view controllers

- [Displaying and managing views with a view controller](uikit/displaying-and-managing-views-with-a-view-controller.md)
- [Showing and hiding view controllers](uikit/showing-and-hiding-view-controllers.md)
- [UIViewController](uikit/uiviewcontroller.md)
- [UITableViewController](uikit/uitableviewcontroller.md)
- [UICollectionViewController](uikit/uicollectionviewcontroller.md)
