Skip to content

Commit 5e298b1

Browse files
Adlai-HollerAdlai Holler
authored andcommitted
[Cherry-pick] facebookarchive#499 viewModel -> nodeViewModel
1 parent 3a10924 commit 5e298b1

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- [ASTextNode2] Provide compile flag to globally enable new implementation of ASTextNode: ASTEXTNODE_EXPERIMENT_GLOBAL_ENABLE. [Scott Goodson](https://github.com/appleguy) [#396](https://github.com/TextureGroup/Texture/pull/410)
1515
- Add ASCollectionGalleryLayoutDelegate - an async collection layout that makes same-size collections (e.g photo galleries, pagers, etc) fast and lightweight! [Huy Nguyen](https://github.com/nguyenhuy/) [#76](https://github.com/TextureGroup/Texture/pull/76) [#451](https://github.com/TextureGroup/Texture/pull/451)
1616
- 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)
17+
- Rename ASCellNode.viewModel to ASCellNode.nodeViewModel to reduce collisions with subclass properties implemented by clients. [Adlai Holler](https://github.com/Adlai-Holler) [#499](https://github.com/TextureGroup/Texture/pull/499)
1718

1819
##2.3.4
1920
- [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with improved behavior and cleaner integration [Scott Goodson](https://github.com/appleguy)

Source/ASCellNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
123123
*
124124
* This property may be set off the main thread, but this method will never be invoked concurrently on the
125125
*/
126-
@property (atomic, nullable) id viewModel;
126+
@property (atomic, nullable) id nodeViewModel;
127127

128128
/**
129129
* Asks the node whether it can be updated to the given view model.

Source/ASCellNode.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ - (void)__setHighlightedFromUIKit:(BOOL)highlighted;
172172

173173
- (BOOL)canUpdateToViewModel:(id)viewModel
174174
{
175-
return [self.viewModel class] == [viewModel class];
175+
return [self.nodeViewModel class] == [viewModel class];
176176
}
177177

178178
- (NSIndexPath *)indexPath

Source/Details/ASCollectionElement.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ - (ASCellNode *)node
6464
node.owningNode = _owningNode;
6565
node.collectionElement = self;
6666
ASTraitCollectionPropagateDown(node, _traitCollection);
67-
node.viewModel = _viewModel;
67+
node.nodeViewModel = _viewModel;
6868
_node = node;
6969
}
7070
return _node;

Tests/ASCollectionModernDataSourceTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ - (void)assertCollectionNodeContent
254254
id viewModel = viewModels[indexPath.item];
255255
XCTAssertEqualObjects(viewModel, [collectionNode viewModelForItemAtIndexPath:indexPath]);
256256
ASCellNode *node = [collectionNode nodeForItemAtIndexPath:indexPath];
257-
XCTAssertEqualObjects(node.viewModel, viewModel);
257+
XCTAssertEqualObjects(node.nodeViewModel, viewModel);
258258
}
259259
}
260260
}

0 commit comments

Comments
 (0)