-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS 11 UITableView automatic height estimation fix #485
iOS 11 UITableView automatic height estimation fix #485
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Maybe we should add some comment above the iOS 11 check to explain why this is necessary. @nguyenhuy what do you think? If not let's just get it in!
@maicki That makes sense to me, at first blush it's definitely not obvious why it's there. I added in a note! |
Good call, @maicki. Will merge after CI passes. |
* Add iOS 11 checks. * Negate iOS 11 automatic table height estimatation * Negate iOS 11 automatic estimated table row heights * Add note about iOS 11 estimated height behavior
Starting in iOS 11
UITableView
automatically uses estimated heights. (Source)This causes some odd behaviour in Texture, specifically with batch fetching where a lot of jumping can happen when the load occurs.
User djug in the Slack encountered this issue earlier and posted their solution which is the basis for this, and is as simple as re-disabling the new default behaviour so that automatic height estimation does not occur.
In order to let this occur only on iOS 11 (not sure if there's any pre-iOS-11 code running on the assumption of the old default, don't want to cause a regression) I made it only occur on iOS 11 and later. This required an addition to
ASAvailability.h
, and like iOS 10 it's unfortunately not explicitly set, so I set it to what iOS 11 beta 4 currently outputs as itskCFCoreFoundationVersionNumber
:1438.1
.(Interestingly Xcode 9 now allows for Objective-C to use the Swift-esque
@availability
checks, which may be worth looking into, but it obviously would break compatibility with previous versions of Xcode.)Overall simple change that helps scrolling on iOS 11 to behave as expected.