diff --git a/React/Views/RCTShadowView+Layout.h b/React/Views/RCTShadowView+Layout.h index f80ef434c3c03b..917b5f4a509a15 100644 --- a/React/Views/RCTShadowView+Layout.h +++ b/React/Views/RCTShadowView+Layout.h @@ -13,9 +13,28 @@ @interface RCTShadowView (Layout) +#pragma mark - Computed Layout-Inferred Metrics + @property (nonatomic, readonly) UIEdgeInsets paddingAsInsets; @property (nonatomic, readonly) UIEdgeInsets borderAsInsets; @property (nonatomic, readonly) UIEdgeInsets compoundInsets; @property (nonatomic, readonly) CGSize availableSize; +#pragma mark - Dirty Propagation Control + +/** + * Designated method to control dirty propagation mechanism. + * Dirties the shadow view (and all affected shadow views, usually a superview) + * in terms of layout. + * The default implementaion does nothing. + */ +- (void)dirtyLayout; + +/** + * Designated method to control dirty propagation mechanism. + * Clears (makes not dirty) the shadow view. + * The default implementaion does nothing. + */ +- (void)clearLayout; + @end diff --git a/React/Views/RCTShadowView+Layout.m b/React/Views/RCTShadowView+Layout.m index 783ea95b2bf7d0..b5e11e8d62ed42 100644 --- a/React/Views/RCTShadowView+Layout.m +++ b/React/Views/RCTShadowView+Layout.m @@ -13,6 +13,8 @@ @implementation RCTShadowView (Layout) +#pragma mark - Computed Layout-Inferred Metrics + - (UIEdgeInsets)paddingAsInsets { YGNodeRef yogaNode = self.yogaNode; @@ -53,4 +55,16 @@ - (CGSize)availableSize return UIEdgeInsetsInsetRect((CGRect){CGPointZero, self.frame.size}, self.compoundInsets).size; } +#pragma mark - Dirty Propagation Control + +- (void)dirtyLayout +{ + // The default implementaion does nothing. +} + +- (void)clearLayout +{ + // The default implementaion does nothing. +} + @end