Link Search Menu Expand Document

ContentContainer

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

public protocol ContentContainer 

Requirements

willTransition(to:​with:​)

Notifies the container that the size of its view is about to change.

func willTransition(to: Size,
                      with coodinator: ViewControllerTransitionCoordinator)

willTransition(to:​with:​)

Notifies the container that its trait collection changed.

func willTransition(to: TraitCollection,
                      with coordinator: ViewControllerTransitionCoordinator)

preferredContentSize

The preferred size for the container’s content.

var preferredContentSize: Size 

size(forChildContentContainer:​withParentContainerSize:​)

Returns the size of the specified child view controller’s content.

func size(forChildContentContainer container: ContentContainer,
            withParentContainerSize parentSize: Size) -> Size

preferredContentSizeDidChange(forChildContentContainer:​)

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

func preferredContentSizeDidChange(forChildContentContainer container: ContentContainer)

systemLayoutFittingSizeDidChange(forChildContentContainer:​)

Notifies the container that a child view controller was resized using auto layout.

func systemLayoutFittingSizeDidChange(forChildContentContainer container: ContentContainer)