I have a screen, that is essential a chat viewController using a viewcontroller with tableView. The design requirements for this screen is to keep the footer docked at the end of the view controller until the tableview needs to start to scroll (at the point where the last cell will be push the tableView + footer downwards. Which then starts scrolling with the last element of the cell.
How can this be achieved? I have been scratching my head, against it. As the app seems to going to follow this design everywhere, but in some screens there wont any content at the start of the user interaction like the chat screen i am stuck on at the moment.
I have tried to add it to the tableview footer, and change its size (keeping the real footer docked) as the number of cells is inserted, but it is causing the table view to be quite bouncy (as opposed to just inserting downwards).
UITableView inherits from UIScrollView, so you can override scrollViewDidScroll to get the realtime x and y translations. Note: this function will be called a lot of times.
I've never done a disappearing header/footer myself but I would probably use a regular view for the footer and animate one of the constraints with the y translation.
In scrollViewDidScroll, take scrollView.contentOffset.y and animate the footers constraints to push it offscreen. You'll need to come up with a little formula for whichever constraint constant you are animating.