Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

[ASCollectionView] When Resizing, Invalidate Layout After Remeasuring #1931

Merged
merged 1 commit into from
Jul 15, 2016

Conversation

Adlai-Holler
Copy link
Contributor

This fixes rotation issues @rcancro and I have seen. It is still being tested.

@ghost ghost added the CLA Signed label Jul 15, 2016
@Adlai-Holler
Copy link
Contributor Author

OK this is working super good! Could this get some inspection from @maicki @levi @appleguy

@@ -857,7 +857,7 @@ - (void)layoutSubviews
_nextLayoutInvalidationStyle = ASCollectionViewInvalidationStyleNone;
switch (invalidationStyle) {
case ASCollectionViewInvalidationStyleWithAnimation:
if (!_superPerformingBatchUpdates) {
if (0 == _superBatchUpdateCount) {
Copy link
Contributor

@maicki maicki Jul 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@appleguy @Adlai-Holler What is the opinion about the code style? I personally would prefer _superBatchUpdateCount == 0, but we should find a way that works for all and the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For BOOLs I prefer NO == _myBool so you can immediately see the NO. For all other assignments this "defensive ordering" with constant on the left prevents people from accidentally using a single =, so I think we should standardize on that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I'm pretty sure the compiler catches a single = for you now.
screen shot 2016-07-15 at 4 19 30 pm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh neat!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Adlai-Holler I understand the value in this style, but for now let's match the prevailing style, which is == NO

@maicki
Copy link
Contributor

maicki commented Jul 15, 2016

One comment but otherwise looks good

@ghost ghost added the CLA Signed label Jul 15, 2016
@hannahmbanana
Copy link
Contributor

Assuming this passes user testing, it sounds like this should be cherry picked to 6.8

@appleguy appleguy merged commit dda7acc into master Jul 15, 2016
@Adlai-Holler Adlai-Holler deleted the AHInvalidateCollectionViewAfterResize branch July 15, 2016 23:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants