Remove assertion in calculateSizeThatFits: and add a log event (#299)

This commit is contained in:
Michael Schneider
2017-05-23 08:14:26 -07:00
committed by GitHub
parent a6c3517cf6
commit 8a9c6e8145

View File

@@ -1049,11 +1049,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
{
__ASDisplayNodeCheckForLayoutMethodOverrides;
#if ASDISPLAYNODE_ASSERTIONS_ENABLED
if (ASIsCGSizeValidForSize(constrainedSize) == NO) {
NSLog(@"Cannot calculate size of node: constrainedSize is infinite and node does not override -calculateSizeThatFits: or specify a preferredSize. Try setting style.preferredSize. Node: %@", [self displayNodeRecursiveDescription]);
}
#endif
ASDisplayNodeLogEvent(self, @"calculateSizeThatFits: with constrainedSize: %@", NSStringFromCGSize(constrainedSize));
return ASIsCGSizeValidForSize(constrainedSize) ? constrainedSize : CGSizeZero;
}