title: UIScrollView with sticky footer UIView and dynamic height content
body: <p>Challenge time!</p>
  
  <p>Imagine we have 2 content views:</p>
  
  <ol>
  <li>UIView with dynamically height content (expandable UITextView) = RED</li>
  <li>UIView as a footer = BLUE</li>
  </ol>
  
  <p>This content is inside a UIScrollView = GEEN</p>
  
  <p>How should I structure and handle the constraints with auto-layout to archive all the following cases?</p>
  
  <p>I am thinking next basic structure to start with:</p>
  
  <pre><code>- UIScrollView (with always bounce vertically)
      - UIView - Container
         - UIView - DynamicHeightContent
         - UIView - Sticky Footer
  </code></pre>
  
  <p>Keyboard handling should be done by code watching notifications <code>UIKeyboardWillShowNotification</code> and <code>UIKeyboardWillHideNotification</code>. We can chose to set the keyboard's end frame height to Container UIView bottom pin constraint or to the UIScrollView bottom contentInset. </p>
  
  <p>Now, the tricky part is the sticky footer.</p>
  
  <ul>
  <li>How we make sure the sticky footer UIView stays at the bottom if there is more screen available than the whole Container View? </li>
  <li>How do we know the available screen space when the keyboard is shown/hidden? we'll surely need it.</li>
  <li>Is is it right this structure I purpose? </li>
  </ul>
  
  <p>Thank you.</p>
  
  <p><img src="https://i.stack.imgur.com/KBY2B.jpg" alt="Case recreation"></p>