From 992df788010d5226fd07b24dc7474fb464346db1 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 22 Jun 2017 19:12:41 +0100 Subject: [PATCH] Gate orphaned node detector behind YOGA flag #trivial (#380) * Gate orphaned node detector behind YOGA flag * Tiny indentation change --- Source/ASDisplayNode+Layout.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index 9c3aac271d..1506c78244 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -143,7 +143,7 @@ ASPrimitiveTraitCollectionDeprecatedImplementation { NSString *string = NSStringFromClass([self class]); if (_debugName) { - string = [string stringByAppendingString:[NSString stringWithFormat:@"\"%@\"",_debugName]]; + string = [string stringByAppendingString:[NSString stringWithFormat:@"\"%@\"", _debugName]]; } return string; } @@ -864,7 +864,11 @@ ASPrimitiveTraitCollectionDeprecatedImplementation - (void)_pendingLayoutTransitionDidComplete { + // This assertion introduces a breaking behavior for nodes that has ASM enabled but also manually manage some subnodes. + // Let's gate it behind YOGA flag and remove it right after a branch cut. +#if YOGA [self _assertSubnodeState]; +#endif // Subclass hook [self calculatedLayoutDidChange];