Rename -[ASCellNode viewModel] to -[ASCellNode nodeViewModel] to avoid collisions (#499)

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

* Update test

* Update the changelog
This commit is contained in:
Adlai Holler 2017-08-07 11:04:31 -07:00 committed by GitHub
parent 49b1f82c5a
commit d2adb8f126
5 changed files with 5 additions and 4 deletions

View File

@ -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)

View File

@ -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.

View File

@ -172,7 +172,7 @@
- (BOOL)canUpdateToViewModel:(id)viewModel
{
return [self.viewModel class] == [viewModel class];
return [self.nodeViewModel class] == [viewModel class];
}
- (NSIndexPath *)indexPath

View File

@ -64,7 +64,7 @@
node.owningNode = _owningNode;
node.collectionElement = self;
ASTraitCollectionPropagateDown(node, _traitCollection);
node.viewModel = _viewModel;
node.nodeViewModel = _viewModel;
_node = node;
}
return _node;

View File

@ -254,7 +254,7 @@
id viewModel = viewModels[indexPath.item];
XCTAssertEqualObjects(viewModel, [collectionNode viewModelForItemAtIndexPath:indexPath]);
ASCellNode *node = [collectionNode nodeForItemAtIndexPath:indexPath];
XCTAssertEqualObjects(node.viewModel, viewModel);
XCTAssertEqualObjects(node.nodeViewModel, viewModel);
}
}
}