Instance Property

preferredContentSize

The preferred size for the container’s content.

Required.

Declaration

var preferredContentSize: CGSize { get }

Discussion

The UIViewController class implements a writable version of this property.

See Also

Responding to Changes in Child View Controllers

func size(forChildContentContainer: UIContentContainer, withParentContainerSize: CGSize) -> CGSize

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

Required.

func preferredContentSizeDidChange(forChildContentContainer: UIContentContainer)

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

Required.

func systemLayoutFittingSizeDidChange(forChildContentContainer: UIContentContainer)

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

Required.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software