From e8bc96860814cc2b502f886533d70149a70b4b32 Mon Sep 17 00:00:00 2001 From: Christian Selig Date: Sun, 30 Jul 2017 00:57:13 -0300 Subject: [PATCH 1/4] Add iOS 11 checks. --- Source/Base/ASAvailability.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Base/ASAvailability.h b/Source/Base/ASAvailability.h index ff7181602..64c5a127e 100644 --- a/Source/Base/ASAvailability.h +++ b/Source/Base/ASAvailability.h @@ -27,8 +27,13 @@ #define kCFCoreFoundationVersionNumber_iOS_10_0 1348.00 #endif +#ifndef kCFCoreFoundationVersionNumber_iOS_11_0 + #define kCFCoreFoundationVersionNumber_iOS_11_0 1438.10 +#endif + #define AS_AT_LEAST_IOS9 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0) #define AS_AT_LEAST_IOS10 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_10_0) +#define AS_AT_LEAST_IOS11 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_11_0) // If Yoga is available, make it available anywhere we use ASAvailability. // This reduces Yoga-specific code in other files. From 6fb0d8279711993c9946f5562df8fc34421fb145 Mon Sep 17 00:00:00 2001 From: Christian Selig Date: Sun, 30 Jul 2017 00:58:29 -0300 Subject: [PATCH 2/4] Negate iOS 11 automatic table height estimatation --- Source/ASTableView.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index 7cf6abcc3..dce18f514 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -345,6 +345,12 @@ - (instancetype)_initWithFrame:(CGRect)frame style:(UITableViewStyle)style dataC _retainedLayer = self.layer; } + if (AS_AT_LEAST_IOS11) { + super.estimatedRowHeight = 0.0; + super.estimatedSectionHeaderHeight = 0.0; + super.estimatedSectionFooterHeight = 0.0; + } + return self; } From bd65b426c34c3fba5e996df5fa9266faa0922f5c Mon Sep 17 00:00:00 2001 From: Christian Selig Date: Mon, 31 Jul 2017 11:09:23 -0300 Subject: [PATCH 3/4] Negate iOS 11 automatic estimated table row heights --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4164075f5..fded8b133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fix an issue that causes infinite layout loop in ASDisplayNode after [#428](https://github.com/TextureGroup/Texture/pull/428) [Huy Nguyen](https://github.com/nguyenhuy) [#455](https://github.com/TextureGroup/Texture/pull/455) - Fix an issue in layout transition that causes it to unexpectedly use the old layout [Huy Nguyen](https://github.com/nguyenhuy) [#464](https://github.com/TextureGroup/Texture/pull/464) - Add -[ASDisplayNode detailedLayoutDescription] property to aid debugging. [Adlai Holler](https://github.com/Adlai-Holler) [#476](https://github.com/TextureGroup/Texture/pull/476) +- Negate iOS 11 automatic estimated table row heights. [Christian Selig](https://github.com/christianselig) [#485](https://github.com/TextureGroup/Texture/pull/485) ##2.3.5 - Fix an issue where inserting/deleting sections could lead to inconsistent supplementary element behavior. [Adlai Holler](https://github.com/Adlai-Holler) From 2de0c623cafb76e543fe1188ad18ebf838340e32 Mon Sep 17 00:00:00 2001 From: Christian Selig Date: Thu, 3 Aug 2017 13:19:06 -0300 Subject: [PATCH 4/4] Add note about iOS 11 estimated height behavior --- Source/ASTableView.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index dce18f514..3f230ba40 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -345,6 +345,7 @@ - (instancetype)_initWithFrame:(CGRect)frame style:(UITableViewStyle)style dataC _retainedLayer = self.layer; } + // iOS 11 automatically uses estimated heights, so disable those (see PR #485) if (AS_AT_LEAST_IOS11) { super.estimatedRowHeight = 0.0; super.estimatedSectionHeaderHeight = 0.0;