This fixes TTTableViewController resize for keyboard not working for tableviews that are not reaching the bottom of the screen (when there's a tabbar or toolbar for instance).
This was originally submitted as part of the fixes in #307
To make it easier for you to merge it, it is now based off the facebook:development branch.
Fixed tableview resize for keyboard not working for tableviews that a…
…re not reaching the bottom of the screen (when there's a tabbar or toolbar for instance).
Removed call to get keyWindow:
according to the doc, "If view is nil, this method instead converts from window base coordinates."
What's going on here? From what I can tell, self.tableView.superview should always resolve to self.view, so we're converting the screen boundaries, 0, 0, 320, 480 into self.view's coordinates, which would result in 0, 0, 320, 480 if there is no navigation bar, 0, -44, 320, 480 if there is.
0, 0, 320, 480
0, -44, 320, 480
I'm weary about doing any calculations based on the screen size. For example, if this table view controller is presented in a popover controller on the iPad, then I feel like these calculations might not work as expected.
This seems sensible. I wonder why weren't doing this already though. The difference between these two lines is one of "relational" vs "absolute". In the former, if the table view is offset vertically for any reason then the frame will be accounted for correctly. The latter does not consider this, however.
A simple example might be in the Facebook iPhone app, where we show a composer anchored at the top of the newsfeed view. self.view.height here could potentially cause the table view to be shifted underneath the newsfeed view incorrectly.
Facebook has not maintained or supported Three20 for some time, and we are closing its old and outstanding pull requests.
Many, many thanks for your support of the project. If you have any further questions, please don't hesitate to let me know.