Skip to content
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

Merged
merged 5 commits into from
Aug 4, 2017
Merged

iOS 11 UITableView automatic height estimation fix #485

merged 5 commits into from
Aug 4, 2017

Conversation

christianselig
Copy link
Contributor

@christianselig christianselig commented Jul 30, 2017

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 its kCFCoreFoundationVersionNumber: 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.

@CLAassistant
Copy link

CLAassistant commented Jul 30, 2017

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@nguyenhuy nguyenhuy left a 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!

Copy link
Contributor

@maicki maicki left a 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!

@christianselig
Copy link
Contributor Author

christianselig commented Aug 3, 2017

@maicki That makes sense to me, at first blush it's definitely not obvious why it's there. I added in a note!

@nguyenhuy
Copy link
Member

Good call, @maicki. Will merge after CI passes.

@nguyenhuy nguyenhuy merged commit 10efa31 into TextureGroup:master Aug 4, 2017
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants