I am trying to achieve a pretty complex view hierarchy. My idea is to build a UI similar to the AirPods and HomePod configurator sheet showing from the bottom part of the screen.
I have a fullscreen UIViewController
which has a child view controller of type UINavigationController
. In this navigation controller, I will push and manager all my view controllers.
Now I have a view controller which has a UIStackView with some content in it, and it's text has variable size. Currently, the navigationController
has a fixed height constraint but obviously I want to change that height based on the size of the content of the visible view controller currently in the navigationController
stack.
Here is a picture of what the view hierarchy currently looks like.
I tried different approaches like setting the compression resistance priority on the labels to 1000 to avoid them clipping but the container view has a fixed height, so they don't grow in any way. Basically, I need a way to figure the content of the UIStackView
and then pass that height to the top most view controller which changes the height constant of the UINavigationController
.
Did anyone implement a system to manage this kind of view hierarchy?