title: I want a UITableView inside of a UIScrollView to extend to the bottom of the UIScrollView and not get cut off by initial screen
body: <p>so I have a viewcontroller that I put a scrollview in. Inside the scrollview, I put a bunch of items in the top half, like an image, labels, and buttons. On the bottom half, I put a uitableview. I set all the constraints and everything.
  I used the following code:</p>
  
  <pre><code>let bounds: CGRect = UIScreen.main.bounds
  let w:Int  = Int(bounds.size.width)
  let h:Int = Int(chaptersTableView.contentSize.height)
  let temp: Int = 300 + h
  scrollView.contentSize = CGSize(width: w, height: temp)
  chaptersTableView.frame = CGRect (x: 0, y: 280.5, width: self.view.frame.size.width, height: CGFloat(44 * sampleModel.objectChapterList.count))
  </code></pre>
  
  <p>I wanted to set the contentsize of the scrollview, and then set the height of my tableview frame.</p>
  
  <p>The tableview is meant to contain many items, so I want the user to be able to scroll down, and the entire contents of the scrollview to scroll down to reveal more of the tableview. However, the tableview always gets cut off and when I scroll down in the scrollview, the table ends. I have to scroll inside of the tableview to access more cells.</p>
  
  <p>Even when I replace the "44 * (number of cells in my table)" with a random number like 100, it will at first cut the table off so that is it short, but then when I tap the screen, the table will change to resume being full length to the bottom of the screen (but not to bottom of scrollview).</p>
  
  <p>I thought about making all the stuff in the top half of the scrollview just another cell of the tableview so that it can be part of the table and I can avoid this hassle, but that would be a lot of work so I wanted to see if I could do this.</p>
  
  <p>If you need pictures or something, I can provide them. If I'm not being clear, make sure to comment and I can explain better.</p>