diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b75bdf53..0c09ba46d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Source/ASCellNode.h b/Source/ASCellNode.h index ca9dda629..bcd5b9ccf 100644 --- a/Source/ASCellNode.h +++ b/Source/ASCellNode.h @@ -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. diff --git a/Source/ASCellNode.mm b/Source/ASCellNode.mm index e3d2d25e5..6ff4b7d83 100644 --- a/Source/ASCellNode.mm +++ b/Source/ASCellNode.mm @@ -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 diff --git a/Source/Details/ASCollectionElement.mm b/Source/Details/ASCollectionElement.mm index 955cc5f11..3c16011da 100644 --- a/Source/Details/ASCollectionElement.mm +++ b/Source/Details/ASCollectionElement.mm @@ -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; diff --git a/Tests/ASCollectionModernDataSourceTests.m b/Tests/ASCollectionModernDataSourceTests.m index ec97e8c64..5fd096f19 100644 --- a/Tests/ASCollectionModernDataSourceTests.m +++ b/Tests/ASCollectionModernDataSourceTests.m @@ -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); } } }