I am trying to make expandable cells using combination of UITableViewAutomaticDimension
row height and Autolayout of the cells. To make things simple, I started
Setting the height constraint priority to 999 may feel like a hack, but according to Apple's docs:
NOTE Don’t feel obligated to use all 1000 priority values. In fact, priorities should general cluster around the system-defined low (250), medium (500), high (750), and required (1000) priorities. You may need to make constraints that are one or two points higher or lower than these values, to help prevent ties. If you’re going much beyond that, you probably want to reexamine your layout’s logic.
Probably a little less than intuitive:
"I want the button height to control the cell height, so lower its priority????"
But, that does appear to be the "correct" way to do it.
Ref: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/AnatomyofaConstraint.html#//apple_ref/doc/uid/TP40010853-CH9-SW19
Remove the height constraint i.e 200 as it is conflicting with top and bottom constraint.
Hope it helps..