diff --git a/YogaKit/Source/UIView+Yoga.h b/YogaKit/Source/UIView+Yoga.h index 0dce4993..49f97cd0 100644 --- a/YogaKit/Source/UIView+Yoga.h +++ b/YogaKit/Source/UIView+Yoga.h @@ -20,6 +20,10 @@ typedef void (^YGLayoutConfigurationBlock)(YGLayout *); The YGLayout that is attached to this view. It is lazily created. */ @property (nonatomic, readonly, strong) YGLayout *yoga; +/** + Indicates whether or not Yoga is enabled + */ +@property (nonatomic, readonly, assign) BOOL isYogaEnabled; /** In ObjC land, every time you access `view.yoga.*` you are adding another `objc_msgSend` diff --git a/YogaKit/Source/UIView+Yoga.m b/YogaKit/Source/UIView+Yoga.m index 4448b377..6b8d921b 100644 --- a/YogaKit/Source/UIView+Yoga.m +++ b/YogaKit/Source/UIView+Yoga.m @@ -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) {