-
Notifications
You must be signed in to change notification settings - Fork 57
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
Stability, Layout, and Logging Enhancements; Added Support for Legacy Edge Insets Functionality #202
Stability, Layout, and Logging Enhancements; Added Support for Legacy Edge Insets Functionality #202
Conversation
… Edge Insets Functionality Squashed Commit of the following: commit 89ef650 Author: Will Spurgeon <[email protected]> Date: Thu Nov 9 10:16:10 2017 -0500 Added additional verbose logging to refresh/reloading of data. commit cee70e8 Author: Will Spurgeon <[email protected]> Date: Thu Nov 2 15:05:39 2017 -0400 Clear prefetch index paths upon invalidation. Written by nlobue commit c760425 Author: Will Spurgeon <[email protected]> Date: Mon Oct 30 16:50:56 2017 -0400 Fix for a crash that can occur if the first index is greater the number of items. commit a838e8d Author: Will Spurgeon <[email protected]> Date: Mon Oct 23 14:15:58 2017 -0400 Updated height provider code to be a closure (wayfair-archive#191). Fix by vlozko. commit 5e21936 Author: Will Spurgeon <[email protected]> Date: Wed Oct 18 14:06:09 2017 -0400 Fix for crash commit 48846ee Author: Will Spurgeon <[email protected]> Date: Fri Oct 13 10:04:59 2017 -0400 Attempt to fix a crash commit e6d3c6d Author: Will Spurgeon <[email protected]> Date: Thu Oct 5 17:28:58 2017 -0400 Added a flag that determines which version of the inset updating code is run.
Codecov Report
@@ Coverage Diff @@
## master #202 +/- ##
=========================================
Coverage ? 92.82%
=========================================
Files ? 40
Lines ? 4513
Branches ? 376
=========================================
Hits ? 4189
Misses ? 323
Partials ? 1
Continue to review full report at Codecov.
|
super.reloadData() | ||
} | ||
|
||
|
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.
Extra space
if !didUpdateEdgeInsets { | ||
guard let brickAttributes = layoutAttributes as? BrickLayoutAttributes, brickAttributes.isEstimateSize else { | ||
return layoutAttributes | ||
if needsLegacyEdgeInsetFunctionality { |
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.
Is this if statement really necessary
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.
Yes, this is also a key part of the legacy edge insets 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.
k
private var didUpdateEdgeInsets: Bool = false | ||
@objc open dynamic var edgeInsets: UIEdgeInsets = UIEdgeInsets.zero { | ||
didSet { | ||
if edgeInsets == oldValue { | ||
|
||
if edgeInsets == oldValue && needsLegacyEdgeInsetFunctionality { |
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.
Is needsLegacyEdgeInsetFunctionality
really necessary here
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.
Yes, that's definitely required for the fix/workaround for the edge insets issue. This legacy edge insets support will be removed once the root cause of the issue is identified (there is a ticket for that work).
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.
ok
I pushed two commits:
|
Includes a fix (and unit tests) for the crashes that occur due to changing repeat counts. @rubencagnie has looked at this change and agreed it looks good.
Add the flag needsLegacyEdgeInsetFunctionality to BrickCell, which defaults to false, but can be set to true if the legacy handling of edge insets is required.
Remove some forced unwraps in BrickFlowLayout to avoid crashes.
Fix a crash that could occur due to calculating layouts of deleted sections in BrickFlowLayout.
Refactor Height provider to be a closure instead of protocol.
Fix a crash due to unchecked bounds of a range creation in BrickLayoutSection
Clear prefetch index paths upon invalidation.
Add additional verbose logging to refresh/reloading of data.
Squashed Commit of the following:
commit 89ef650
Author: Will Spurgeon [email protected]
Date: Thu Nov 9 10:16:10 2017 -0500
commit cee70e8
Author: Will Spurgeon [email protected]
Date: Thu Nov 2 15:05:39 2017 -0400
commit c760425
Author: Will Spurgeon [email protected]
Date: Mon Oct 30 16:50:56 2017 -0400
commit a838e8d
Author: Will Spurgeon [email protected]
Date: Mon Oct 23 14:15:58 2017 -0400
commit 5e21936
Author: Will Spurgeon [email protected]
Date: Wed Oct 18 14:06:09 2017 -0400
commit 48846ee
Author: Will Spurgeon [email protected]
Date: Fri Oct 13 10:04:59 2017 -0400
commit e6d3c6d
Author: Will Spurgeon [email protected]
Date: Thu Oct 5 17:28:58 2017 -0400