Introduction of RCTRootViewDelegate

Reviewed By: adamjernst

Differential Revision: D2532327

fb-gh-sync-id: 0d018a6c2842f8021718fb7387ee6acb5d894645
This commit is contained in:
Pawel Sienkowski
2015-10-26 15:39:06 -07:00
committed by facebook-github-bot-7
parent 46803f0617
commit 576f5d79af
5 changed files with 88 additions and 5 deletions

View File

@@ -11,12 +11,14 @@
#import "RCTBridge.h"
@protocol RCTRootViewDelegate;
/**
* This enum is used to define size flexibility type of the root view.
* If a dimension is flexible, the view will recalculate that dimension
* so the content fits. Recalculations are performed when the root's frame,
* size flexibility mode or content size changes. After a recalculation,
* TODO:<DelegateName> will be called with the new size passed as an argument.
* rootViewDidChangeIntrinsicSize method of the RCTRootViewDelegate will be called.
*/
typedef NS_ENUM(NSInteger, RCTRootViewSizeFlexibility) {
RCTRootViewSizeFlexibilityNone = 0,
@@ -90,6 +92,17 @@ extern NSString *const RCTContentDidAppearNotification;
*/
@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility;
/**
* The size of the root view's content. This is set right before the
* rootViewDidChangeIntrinsicSize method of RCTRootViewDelegate is called.
*/
@property (readonly, nonatomic, assign) CGSize intrinsicSize;
/**
* The delegate that handles intrinsic size updates.
*/
@property (nonatomic, weak) id<RCTRootViewDelegate> delegate;
/**
* The backing view controller of the root view.
*/