The container view is created using [[UIView alloc] init]; I then put other UIViews, like UIButton, UILabel, UIImageView inside it using autolayout.
My goal is to let one container use its "intrinsicContentSize" while the other takes rest of the space. But it turns out that I have 3 problems,
- Although each subview has its intrinsicContentSize, the container view doesn't have it, its intrinsicContentSize always returns -1
- Without intrinsicContentSize, content hugging and compression resistance priorities are meaningless.
- I tried systemLayoutSizeFittingSize on container, but it always return 0. I didn't figure out why?
How do I achieve my goal then
Update: I figured out why systemLayoutSizeFittingSize always return 0 as explained here get container size but have not achieved my goal yet