Instance Method

sizeForChildContentContainer:withParentContainerSize:

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

Required.

Declaration

- (CGSize)sizeForChildContentContainer:(id<UIContentContainer>)container withParentContainerSize:(CGSize)parentSize;

Parameters

container

The child view controller.

parentSize

The size of the parent view controller.

Return Value

The size to apply to the child view controller.

Discussion

Container view controllers use this method to return the sizes for their child view controllers. UIKit calls the method as part of the default implementation of the viewWillTransitionToSize:withTransitionCoordinator: method for view controllers. It calls the method once for each child view controller embedded in the view controller. If you are implementing a custom container view controller, you should override this method and use it to return the sizes of the contained children.

View controllers and presentation controllers return the value in parentSize by default.

See Also

Responding to Changes in Child View Controllers

- preferredContentSizeDidChangeForChildContentContainer:

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

Required.

- systemLayoutFittingSizeDidChangeForChildContentContainer:

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

Required.

preferredContentSize

The preferred size for the container’s content.

Required.