title: Resize view if subview (un-)hidden
body: <p>I'm new to iOS programming and have a portion of interface that looks like this:
  <img src="https://i.stack.imgur.com/0cjzy.jpg" alt="enter image description here"></p>
  
  <p>What I want it to behave like, is when there are no rows in this table view, the label and a scrollview that contains tableview should be hidden, and parent UIView (gray one) should only wrap text field (preserving margins of course). If some rows are added to the table view (by entering text in text field), the label and table view should appear and this parent UIView should resize to wrap them too. When its height reaches makes it so big that it reaches bottom margin, it shouldn't expand anymore. How to achieve that?</p>
  
  <p>EDIT: to make it more clear, I know how to add rows to table view, how to hide elements, what I don't know is how to resize this parent UIView.</p>
  
  <p>EDIT 2: to make it even more clear for some people: when I hide subviews, their parent view (gray area) has the same size as before, which is similar behavior to what LinearLayout does on Android when its children are hidden. What I want it is to behave like LinearLayout when its children are GONE instead of HIDDEN.</p>