Skip to content

Commit

Permalink
Rename -[ASCellNode viewModel] to -[ASCellNode nodeViewModel] to avoi…
Browse files Browse the repository at this point in the history
…d collisions (TextureGroup#499)

* Rename -[ASCellNode viewModel] -> -[ASCellNode nodeViewModel] to avoid breaking existing code

* Update test

* Update the changelog
  • Loading branch information
Adlai-Holler authored and bernieperez committed Apr 25, 2018
1 parent 5cbc4d9 commit f1ebe24
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 @@ -13,6 +13,7 @@
- Add -[ASDisplayNode detailedLayoutDescription] property to aid debugging. [Adlai Holler](https://github.com/Adlai-Holler) [#476](https://github.com/TextureGroup/Texture/pull/476)
- Fix an issue that causes calculatedLayoutDidChange being called needlessly. [Huy Nguyen](https://github.com/nguyenhuy) [#490](https://github.com/TextureGroup/Texture/pull/490)
- Negate iOS 11 automatic estimated table row heights. [Christian Selig](https://github.com/christianselig) [#485](https://github.com/TextureGroup/Texture/pull/485)
- 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.5
- Fix an issue where inserting/deleting sections could lead to inconsistent supplementary element behavior. [Adlai Holler](https://github.com/Adlai-Holler)
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 f1ebe24

Please sign in to comment.