The table cells are designed with a stack view as the only subview of the cell’s content view: Expanded cells will be taller than collapsed cells, so the table needs to be ready to get the cell height from the cell. It’s apparent that one of the stack view’s changes is to apply an extra height constraint (presumably of height 0) to make the view disappear from its layout.