From fdafdafaaf08f76aeb60602fdf8a521add2e59cc Mon Sep 17 00:00:00 2001 From: Muukii Date: Sun, 1 Oct 2023 15:46:13 +0900 Subject: [PATCH 1/2] :evergreen_tree: Update --- Source/Details/ASDataController.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Details/ASDataController.mm b/Source/Details/ASDataController.mm index 83b3038dc..ec3d39e22 100644 --- a/Source/Details/ASDataController.mm +++ b/Source/Details/ASDataController.mm @@ -197,8 +197,10 @@ - (void)_layoutNode:(ASCellNode *)node withConstrainedSize:(ASSizeRange)constrai if (![_dataSource dataController:self shouldEagerlyLayoutNode:node]) { return; } - - ASDisplayNodeAssert(ASSizeRangeHasSignificantArea(constrainedSize), @"Attempt to layout cell node with invalid size range %@", NSStringFromASSizeRange(constrainedSize)); + + if (ASSizeRangeHasSignificantArea(constrainedSize) == NO) { + ASDisplayNodeFailAssert(@"Attempt to layout cell node with invalid size range %@ in %@", NSStringFromASSizeRange(constrainedSize), [self.node debugDescription]); + } CGRect frame = CGRectZero; frame.size = [node layoutThatFits:constrainedSize].size; From b59e42bc6832e34d9598cc39c7a39b4e82400dc9 Mon Sep 17 00:00:00 2001 From: Muukii Date: Wed, 25 Oct 2023 19:00:24 +0900 Subject: [PATCH 2/2] :evergreen_tree: Update --- Source/Details/ASDataController.mm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Source/Details/ASDataController.mm b/Source/Details/ASDataController.mm index ec3d39e22..16ecfd0ed 100644 --- a/Source/Details/ASDataController.mm +++ b/Source/Details/ASDataController.mm @@ -30,6 +30,9 @@ #import "ASDisplayNode+Subclasses.h" #import "NSIndexSet+ASHelpers.h" +#import "ASCollectionView.h" +#import "ASAssert.h" + //#define LOG(...) NSLog(__VA_ARGS__) #define LOG(...) @@ -199,7 +202,23 @@ - (void)_layoutNode:(ASCellNode *)node withConstrainedSize:(ASSizeRange)constrai } if (ASSizeRangeHasSignificantArea(constrainedSize) == NO) { - ASDisplayNodeFailAssert(@"Attempt to layout cell node with invalid size range %@ in %@", NSStringFromASSizeRange(constrainedSize), [self.node debugDescription]); + + ASPushMainThreadAssertionsDisabled(); + NSString *message = @""; + message = [message stringByAppendingString: @"Attempt to layout cell node with invalid size range."]; + message = [message stringByAppendingFormat: @"range: %@", NSStringFromASSizeRange(constrainedSize)]; + message = [message stringByAppendingFormat: @"layoutDelegate: %@", self.layoutDelegate]; + message = [message stringByAppendingFormat: @"node: %@", self.node]; + message = [message stringByAppendingFormat: @"delegate: %@", self.delegate]; + message = [message stringByAppendingFormat: @"dataSource: %@", self.dataSource]; + + if ([self.layoutDelegate isKindOfClass:[ASCollectionView class]]) { + ASCollectionView *collectionView = (ASCollectionView *) self.layoutDelegate; + message = [message stringByAppendingFormat: @"ASCollectionNode: %@", collectionView.collectionNode]; + } + + ASPopMainThreadAssertionsDisabled(); + ASDisplayNodeFailAssert(message); } CGRect frame = CGRectZero;