From d12400c904f3edb130270c5ad394419a04d62b13 Mon Sep 17 00:00:00 2001 From: Pavel Mazurin Date: Thu, 24 Aug 2017 11:13:48 +0200 Subject: [PATCH] Code review comments --- YogaKit/Source/YGLayout.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index 9cc4a6a7..d22073b9 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -102,6 +102,7 @@ static YGConfigRef globalConfig; @interface YGLayout () @property (nonatomic, weak, readonly) UIView *view; +@property (nonatomic, assign, readonly) BOOL isUIView; @end @@ -126,6 +127,7 @@ static YGConfigRef globalConfig; YGNodeSetContext(_node, (__bridge void *) view); _isEnabled = NO; _isIncludedInLayout = YES; + _isUIView = [view isMemberOfClass:[UIView class]]; } return self; @@ -307,7 +309,7 @@ static YGSize YGMeasureView( CGSize sizeThatFits = CGSizeZero; // Fix for https://github.com/facebook/yoga/issues/606 - if (![view isMemberOfClass:[UIView class]] || [view.subviews count] > 0) { + if (!view.yoga.isUIView || [view.subviews count] > 0) { sizeThatFits = [view sizeThatFits:(CGSize) { .width = constrainedWidth, .height = constrainedHeight,