What I find less well documented is how to implement a self-sizing child view. In this post, I look at how the UIContentContainer protocol allows the child view controller to tell the parent how big it wants to be (and an alternate, possibly simpler, approach).
Source: Self-sizing Child Views