This repository was archived by the owner on Feb 2, 2023. It is now read-only.
[ASCollectionView] Add a "Null Object" for a layout inspector if custom layout is given but no layout inspector#1674
Merged
appleguy merged 1 commit intofacebookarchive:masterfrom Jun 5, 2016
maicki:RefactorASCollectionViewLayoutInspectingUsage
Merged
[ASCollectionView] Add a "Null Object" for a layout inspector if custom layout is given but no layout inspector#1674appleguy merged 1 commit intofacebookarchive:masterfrom maicki:RefactorASCollectionViewLayoutInspectingUsage
appleguy merged 1 commit intofacebookarchive:masterfrom
maicki:RefactorASCollectionViewLayoutInspectingUsage
Conversation
The purpose of the ASCollectionViewCustomLayoutInspector is to provide a default implementation if given a custom layout, but no layout inspector.
| // and asserts for methods that should be implemented in the <ASCollectionViewLayoutInspecting> | ||
| _defaultLayoutInspector = [[ASCollectionViewCustomLayoutInspector alloc] init]; | ||
| } | ||
| _layoutInspector = _defaultLayoutInspector; |
Contributor
There was a problem hiding this comment.
Is the _defaultLayoutInspector ivar necessary or can we make it a local var?
Contributor
Author
There was a problem hiding this comment.
Because _layoutInspector is a weak property
Contributor
There was a problem hiding this comment.
@maicki aha, that makes total sense. Maybe let's call it _strongLayoutInspector so the purpose is more clear.
aimalygin
pushed a commit
to aimalygin/AsyncDisplayKit
that referenced
this pull request
Sep 23, 2019
… Style Changes (facebookarchive#1674) * This PR addresses an issue I raised with facebookarchive#1673 where the clipping corner layer doesn't get re-rendered when going from a dark to light user interface style. The fix is to add code in the `-asyncTraitCollectionDidChangeWithPreviousTraitCollection:` method that calls through to `-_updateClipCornerLayerContentsWithRadius:backgroundColor:` if the user interface style changes. I've also added snapshot tests to verify that using clipping corners with a dynamic background color updates when the user interface style changes.
aimalygin
pushed a commit
to aimalygin/AsyncDisplayKit
that referenced
this pull request
Sep 23, 2019
…nDidChange (facebookarchive#1678) traitCollectionDidChange isn't necessarily called on Main, but our self.backgroundColor property access must be done on main once the view is loaded. I originally opted to use self.backgroundColor rather than _backgroundColor in facebookarchive#1674, but I think we should use the ivar here. This could get out-of-sync if someone modified the UIView's background color instead of updating the node, but I think that's unlikely, so we should be safe to use the ivar here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The purpose of the ASCollectionViewCustomLayoutInspector is to provide a default implementation if a custom layout is given, but no layout inspector. We remove the necessary
ifhandling if no layout inspector is given and replace it with a "Null Object".