Fabric: RCTViewComponentView, storing just applied layoutMetrics

Summary:
This will be useful for this class and for subclasses soon.
For instance, when we draw something in `drawRect:`, we need to know exact content frame for rendering.

Reviewed By: mdvacca

Differential Revision: D7751855

fbshipit-source-id: 5d688368edd7b4f3c8c19d54ca701a9cc361270b
This commit is contained in:
Valentin Shergin 2018-05-08 18:50:05 -07:00 committed by Facebook Github Bot
parent 7e97ed00bc
commit 9646c5cb3c
2 changed files with 13 additions and 1 deletions

View File

@ -9,13 +9,17 @@
#import <React/RCTComponentViewProtocol.h>
#import <React/UIView+ComponentViewProtocol.h>
#import <fabric/core/LayoutMetrics.h>
NS_ASSUME_NONNULL_BEGIN
/**
* UIView class for <View> component.
*/
@interface RCTViewComponentView : UIView <RCTComponentViewProtocol>
@interface RCTViewComponentView : UIView <RCTComponentViewProtocol> {
@protected
facebook::react::LayoutMetrics _layoutMetrics;
}
@end

View File

@ -30,4 +30,12 @@ using namespace facebook::react;
// TODO: Implement all sutable non-layout <View> props.
}
- (void)updateLayoutMetrics:(LayoutMetrics)layoutMetrics
oldLayoutMetrics:(LayoutMetrics)oldLayoutMetrics
{
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
_layoutMetrics = layoutMetrics;
}
@end