Add 'useYoga' property to indicate whether UIView uses Yoga for layout or not

Summary: Now developer could check whether UIView uses Yoga for layout.

Reviewed By: emilsjolander

Differential Revision: D5881242

fbshipit-source-id: 4d1cf0b489b759ff0b9c5091cc51534fd12dcf60
This commit is contained in:
Bin Yu
2017-09-21 09:58:08 -07:00
committed by Facebook Github Bot
parent d90914f3dc
commit 58328d01ef
2 changed files with 9 additions and 0 deletions

View File

@@ -26,6 +26,11 @@ static const void *kYGYogaAssociatedKey = &kYGYogaAssociatedKey;
return yoga;
}
- (BOOL)isYogaEnabled
{
return objc_getAssociatedObject(self, kYGYogaAssociatedKey) != nil;
}
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
{
if (block != nil) {