I have a container content view controller that adds a child view controller and then adjusts some auto layout restrictions for the size of the child view. The child view does not completely fill the container view. The controller of my child view implements viewWillTransitionToSize: withTransitionCoordinator: and displays its contents based on the passed size.
I know that I need to override sizeForChildContent: withParentContainerSize: in the container view controller so that the child gets the correct size in its viewWillTransitionToSize: method. My question is, what is the correct way to calculate the return size (i.e. the size of the child view will be after the restrictions are applied)? I could do some math to calculate the size of the child myself, but this view defeats the goal of determining the child's view using an automatic layout.
source share