title: contentView with UITableView not scrolling within UIScrollView
body: <p>I'm creating a simple "Create your Profile" with many fields. My view is not scrolling despite the content being larger than the size of the scroll view. I think part of the issue is the relationship between the contents inside the contentView. I wanted the cells inside of the table view to be dynamic so that I can add more information later and the scrolling would still preform. I set the scrollView delegate and tableView delegate to self in <code>viewDidLoad()</code> </p>
  
  <p>I've looked at other answers and tried their implementations to no avail. I referenced <a href="https://stackoverflow.com/questions/38485129/height-of-contentview-of-uiscrollview-based-on-inside-content-using-storyboard">Height of contentView of UIScrollView based on inside content using Storyboard</a>, for instance.</p>
  
  <p>To adjust the table view's content dynamically, I wrote the following:</p>
  
  <pre><code> override func viewDidLayoutSubviews() {
          DispatchQueue.main.async {
              var frame = self.tableView.frame
              frame.size.height = self.tableView.contentSize.height
              self.tableView.frame = frame
              self.updateViewConstraints()
  
          }
      }
  </code></pre>
  
  <p>For constraints, my hierarchy is Super View > Scroll View > Content View > Elements. </p>
  
  <p>Essentially, each element depends on it's upper neighbor and each have set heights. The exception is the TableView, whose height is not fixed, and will be stretched according to it's neighbor below it, the error label. The error label is then constrained to the bottom of the view. Here is a more visual representation.
  <a href="https://i.stack.imgur.com/yTP7z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yTP7z.png" alt="layout constraints"></a></p>
  
  <p>Here is the actual result:
  <a href="https://i.stack.imgur.com/32EWQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/32EWQ.jpg" alt="actual result"></a></p>
  
  <p>I think the issue is the Error Label's constraint to the Table View is not being updated, but is there something I'm not seeing here? Everything below the top bar should scroll.</p>