title: How to set the scrollview height when UI elements are dynamically created
body: <p>On the storyboard, inside a view controller I have a scrollview. A navigation bar and a stack view are embedded inside the scrollview.
  Programmatically I am adding some UI elements one below the other inside the stack view.</p>
  
  <p>Via storyboard, constraints of the scrollview are set to the same as safe area - top, bottom, leading, trailing and width.</p>
  
  <p>Navigation bar constraints - trailing, leading, top, width are same as super view. </p>
  
  <p>Stackview constraints - trailing, leading, bottom, width are same as superview. </p>
  
  <p>Navigation bar's bottom is same as stackview's top so that they are one below the other.</p>
  
  <p>After setting these constraints, there is an error about scrollview - need constraints for: Y position or Height</p>
  
  <p>Since the UI elements are being added dynamically to the stackview, How do I set the height in storyboard? Is there a better way to do this?</p>
  
  <p>I tried "add missing constraint" option and it adds a constant height to the stack view which does not work well for all devices.
  Any help is appreciated since I am new to iOS app development. Thanks.</p>