From 0f9fc4b2953d52fa1754e786dc5c74bfecbeaaca Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 5 Feb 2018 22:15:29 -0800 Subject: [PATCH] `processUpdatedProperties` & `collectUpdatedProperties` was removed from RCTShadowView Summary: This is leftovers from last reimplementation; nobody uses it and it does not hooked up with UIManager. Reviewed By: fkgozali Differential Revision: D6887795 fbshipit-source-id: 9e2e29af4ba959270096eeb494666d1cacaeba32 --- React/Views/RCTShadowView.h | 21 --------------------- React/Views/RCTShadowView.m | 24 ------------------------ 2 files changed, 45 deletions(-) diff --git a/React/Views/RCTShadowView.h b/React/Views/RCTShadowView.h index f9680e7ac..76d464fc1 100644 --- a/React/Views/RCTShadowView.h +++ b/React/Views/RCTShadowView.h @@ -16,12 +16,6 @@ @class RCTRootShadowView; @class RCTSparseArray; -typedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) { - RCTUpdateLifecycleUninitialized = 0, - RCTUpdateLifecycleComputed, - RCTUpdateLifecycleDirtied, -}; - typedef void (^RCTApplierBlock)(NSDictionary *viewRegistry); /** @@ -190,21 +184,6 @@ typedef void (^RCTApplierBlock)(NSDictionary *viewRegistry */ @property (nonatomic, assign) CGSize intrinsicContentSize; -/** - * Calculate property changes that need to be propagated to the view. - * The applierBlocks set contains RCTApplierBlock functions that must be applied - * on the main thread in order to update the view. - */ -- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks - parentProperties:(NSDictionary *)parentProperties; - -/** - * Process the updated properties and apply them to view. Shadow view classes - * that add additional propagating properties should override this method. - */ -- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks - parentProperties:(NSDictionary *)parentProperties NS_REQUIRES_SUPER; - /** * Can be called by a parent on a child in order to calculate all views whose frame needs * updating in that branch. Adds these frames to `viewsWithNewFrame`. Useful if layout diff --git a/React/Views/RCTShadowView.m b/React/Views/RCTShadowView.m index 26db521e4..714a5c7a6 100644 --- a/React/Views/RCTShadowView.m +++ b/React/Views/RCTShadowView.m @@ -34,8 +34,6 @@ typedef NS_ENUM(unsigned int, meta_prop_t) { @implementation RCTShadowView { - RCTUpdateLifecycle _propagationLifecycle; - RCTUpdateLifecycle _textLifecycle; NSDictionary *_lastParentProperties; NSMutableArray *_reactSubviews; BOOL _recomputePadding; @@ -264,26 +262,6 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT], } } -- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks - parentProperties:(NSDictionary *)parentProperties -{ - return parentProperties; -} - -- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks - parentProperties:(NSDictionary *)parentProperties -{ - if (_propagationLifecycle == RCTUpdateLifecycleComputed && [parentProperties isEqualToDictionary:_lastParentProperties]) { - return; - } - _propagationLifecycle = RCTUpdateLifecycleComputed; - _lastParentProperties = parentProperties; - NSDictionary *nextProps = [self processUpdatedProperties:applierBlocks parentProperties:parentProperties]; - for (RCTShadowView *child in _reactSubviews) { - [child collectUpdatedProperties:applierBlocks parentProperties:nextProps]; - } -} - - (void)collectUpdatedFrames:(NSMutableSet *)viewsWithNewFrame withFrame:(CGRect)frame hidden:(BOOL)hidden @@ -354,8 +332,6 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT], _intrinsicContentSize = CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric); _newView = YES; - _propagationLifecycle = RCTUpdateLifecycleUninitialized; - _textLifecycle = RCTUpdateLifecycleUninitialized; _reactSubviews = [NSMutableArray array];