title: How to change label constraints during runtime?
body: <p>I have a table view and a cell inside it. The cell contains three labels: header label and two labels below one to each other. Sometimes, I need to hide those two labels below if they do not contain data and change "Top space to container" of "Header label" to "Center Y to container". And of course revert the constraints back when two labels contain data. Here's a screenshot of simple demo project just for showing the idea:</p>
  
  <p><img src="https://i.stack.imgur.com/3So0S.png" alt="enter image description here"></p>
  
  <p><strong>UPDATE</strong> Max MacLeod answer pointed to right direction. The trick is to push header label down when first and second labels are hidden. So we need to set bottom space to container view for first and second labels instead of creating top space to container view for header label. And hiding/unhiding should be done by having height outlets (height constraints for first and second label) and setting their constant values to zero (and setting back value when unhiding). I also uploaded the <a href="https://github.com/centurionas/HidingAndAligning">source code example to Github</a>.</p>