I have a container view controller that can hold any generic ViewController. If I use a stack view, or any other view (without a scroll view), I can accurately calculate the size in my container initializer using the following:
let targetSize = CGSize(width: contentVC.view.bounds.width)
let preferredSize = contentViewcontroller.view.systemLayoutSizeFitting(targetSize)
self.containerHeight = preferredSize.height
However, this stops working once I'm dealing with a table view inside the child vc. The height is returned as zero. What's the best way to handle it without having to do much / any work on the child vc side?
NOTE: I'm using auto layout (SnapKit), to pin and layout my views.