title: Auto layout constraints not taking effect on child controls until parent container is resized (swift)
body: <p>I have a program with an NSSplitView (containing two panes) filling the window. The left pane is an NSStackView and it contains three NSBoxes. The top two each contain an NSTextField for displaying a string of weather information that can change length every time it is updated by code in the background. I have added the relevant constraints to the top two NSBoxes (and their child NSTextFields) to make them expand or shrink to fit the size of the text fields inside them as the text changes length. The third NSBox fills up the remaining space in the stack view.</p>
  
  <p>The problem is that when the window loads, the NSBoxes (as expected) display the correct size as designed in interface builder to fit the default string in the text fields. However, when the update code kicks in and changes the text of the text fields to the downloaded data, which is longer than the default string, the NSBoxes do not adjust their height to fit the larger text. They only change their height when the splitter of the split view is moved. This is annoying because I have to move the splitter every time the number of lines in the text fields changes. Why is this happening and how can I make the boxes update their height to fit the text when it is longer or shorter than before?</p>
  
  <p>It is much like this question (the only source of information I found on my problem): <a href="https://stackoverflow.com/questions/24166592/nsscrollview-with-auto-layout-not-resizing-until-first-manual-window-resize">NSScrollView with auto layout not resizing until first manual window resize</a>, however the solution did not work for me.</p>
  
  <p>Below is an image of the interface (again, the top two boxes should resize to fit their text but this only happens when the splitter is moved). It shows longer text than the boxes can display and they haven't resized:</p>
  
  <p><a href="https://i.stack.imgur.com/vin3k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vin3k.png" alt="screenshot"></a></p>