Skip to content
Permalink
Browse files

`processUpdatedProperties` & `collectUpdatedProperties` was removed f…

…rom RCTShadowView

Summary: This is leftovers from last <Text> reimplementation; nobody uses it and it does not hooked up with UIManager.

Reviewed By: fkgozali

Differential Revision: D6887795

fbshipit-source-id: 9e2e29af4ba959270096eeb494666d1cacaeba32
  • Loading branch information...
shergin authored and facebook-github-bot committed Feb 6, 2018
1 parent ce50f25 commit 0f9fc4b2953d52fa1754e786dc5c74bfecbeaaca
Showing with 0 additions and 45 deletions.
  1. +0 −21 React/Views/RCTShadowView.h
  2. +0 −24 React/Views/RCTShadowView.m
@@ -16,12 +16,6 @@
@class RCTRootShadowView;
@class RCTSparseArray;

typedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) {
RCTUpdateLifecycleUninitialized = 0,
RCTUpdateLifecycleComputed,
RCTUpdateLifecycleDirtied,
};

typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry);

/**
@@ -190,21 +184,6 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *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<RCTApplierBlock> *)applierBlocks
parentProperties:(NSDictionary<NSString *, id> *)parentProperties;

/**
* Process the updated properties and apply them to view. Shadow view classes
* that add additional propagating properties should override this method.
*/
- (NSDictionary<NSString *, id> *)processUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks
parentProperties:(NSDictionary<NSString *, id> *)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
@@ -34,8 +34,6 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {

@implementation RCTShadowView
{
RCTUpdateLifecycle _propagationLifecycle;
RCTUpdateLifecycle _textLifecycle;
NSDictionary *_lastParentProperties;
NSMutableArray<RCTShadowView *> *_reactSubviews;
BOOL _recomputePadding;
@@ -264,26 +262,6 @@ - (void)applyLayoutToChildren:(YGNodeRef)node
}
}

- (NSDictionary<NSString *, id> *)processUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks
parentProperties:(NSDictionary<NSString *, id> *)parentProperties
{
return parentProperties;
}

- (void)collectUpdatedProperties:(NSMutableSet<RCTApplierBlock> *)applierBlocks
parentProperties:(NSDictionary<NSString *, id> *)parentProperties
{
if (_propagationLifecycle == RCTUpdateLifecycleComputed && [parentProperties isEqualToDictionary:_lastParentProperties]) {
return;
}
_propagationLifecycle = RCTUpdateLifecycleComputed;
_lastParentProperties = parentProperties;
NSDictionary<NSString *, id> *nextProps = [self processUpdatedProperties:applierBlocks parentProperties:parentProperties];
for (RCTShadowView *child in _reactSubviews) {
[child collectUpdatedProperties:applierBlocks parentProperties:nextProps];
}
}

- (void)collectUpdatedFrames:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame
withFrame:(CGRect)frame
hidden:(BOOL)hidden
@@ -354,8 +332,6 @@ - (instancetype)init
_intrinsicContentSize = CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);

_newView = YES;
_propagationLifecycle = RCTUpdateLifecycleUninitialized;
_textLifecycle = RCTUpdateLifecycleUninitialized;

_reactSubviews = [NSMutableArray array];

0 comments on commit 0f9fc4b

Please sign in to comment.
You can’t perform that action at this time.