Skip to content

Commit

Permalink
[Cherry-pick] #499 viewModel -> nodeViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai-Holler authored and Adlai Holler committed Aug 15, 2017
1 parent 3a10924 commit 5e298b1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [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)
- 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)
- 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)
- 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)

##2.3.4
- [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with improved behavior and cleaner integration [Scott Goodson](https://github.com/appleguy)
Expand Down
2 changes: 1 addition & 1 deletion Source/ASCellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
*
* This property may be set off the main thread, but this method will never be invoked concurrently on the
*/
@property (atomic, nullable) id viewModel;
@property (atomic, nullable) id nodeViewModel;

/**
* Asks the node whether it can be updated to the given view model.
Expand Down
2 changes: 1 addition & 1 deletion Source/ASCellNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ - (void)__setHighlightedFromUIKit:(BOOL)highlighted;

- (BOOL)canUpdateToViewModel:(id)viewModel
{
return [self.viewModel class] == [viewModel class];
return [self.nodeViewModel class] == [viewModel class];
}

- (NSIndexPath *)indexPath
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASCollectionElement.mm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (ASCellNode *)node
node.owningNode = _owningNode;
node.collectionElement = self;
ASTraitCollectionPropagateDown(node, _traitCollection);
node.viewModel = _viewModel;
node.nodeViewModel = _viewModel;
_node = node;
}
return _node;
Expand Down
2 changes: 1 addition & 1 deletion Tests/ASCollectionModernDataSourceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ - (void)assertCollectionNodeContent
id viewModel = viewModels[indexPath.item];
XCTAssertEqualObjects(viewModel, [collectionNode viewModelForItemAtIndexPath:indexPath]);
ASCellNode *node = [collectionNode nodeForItemAtIndexPath:indexPath];
XCTAssertEqualObjects(node.viewModel, viewModel);
XCTAssertEqualObjects(node.nodeViewModel, viewModel);
}
}
}
Expand Down

0 comments on commit 5e298b1

Please sign in to comment.