Add JS binding for FabricUIManager - iOS

Reviewed By: sebmarkbage

Differential Revision: D6934518

fbshipit-source-id: 1f626f79a74fb199925644e8b16238aa17d40e1f
This commit is contained in:
Kevin Gozali 2018-02-13 22:26:39 -08:00 committed by Facebook Github Bot
parent e165d0dcf0
commit 1aeb9250bd
2 changed files with 61 additions and 26 deletions

View File

@ -10,8 +10,35 @@
#import <UIKit/UIKit.h>
#import <React/RCTBridge.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTInvalidating.h>
#import <React/RCTShadowView.h>
@interface RCTFabricUIManager : NSObject<RCTBridgeModule>
@class RCTShadowView;
/**
* The RCTFabricUIManager is the module responsible for updating the view hierarchy.
*/
@interface RCTFabricUIManager : NSObject <RCTInvalidating>
- (RCTShadowView *)createNode:(nonnull NSNumber *)reactTag
viewName:(NSString *)viewName
rootTag:(nonnull NSNumber *)rootTag
props:(NSDictionary *)props
instanceHandle:(void *)instanceHandle;
- (RCTShadowView *)cloneNode:(RCTShadowView *)node;
- (RCTShadowView *)cloneNodeWithNewChildren:(RCTShadowView *)node;
- (RCTShadowView *)cloneNodeWithNewProps:(RCTShadowView *)node
newProps:(NSDictionary *)props;
- (RCTShadowView *)cloneNodeWithNewChildrenAndProps:(RCTShadowView *)node
newProps:(NSDictionary *)props;
- (void)appendChild:(RCTShadowView *)parentNode
childNode:(RCTShadowView *)childNode;
- (NSMutableArray<RCTShadowView *> *)createChildSet:(nonnull NSNumber *)rootTag;
- (void)appendChildToSet:(NSMutableArray<RCTShadowView *> *)childSet
childNode:(RCTShadowView *)childNode;
- (void)completeRoot:(nonnull NSNumber *)rootTag
childSet:(NSArray<RCTShadowView *> *)childSet;
@end

View File

@ -12,55 +12,63 @@
// This file contains experimental placeholders, nothing is finalized.
@implementation RCTFabricUIManager
@synthesize bridge = _bridge;
RCT_EXPORT_MODULE()
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, createNode:(int)reactTag
viewName:(NSString *)viewName
rootTag:(int)rootTag
props:(NSDictionary *)props
instanceHandle:(int)instanceHandleID)
- (void)dealloc
{
return @0;
}
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, cloneNode:(int)nodeID)
- (void)invalidate
{
return @0;
}
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, cloneNodeWithNewChildren:(int)nodeID)
- (RCTShadowView *)createNode:(nonnull NSNumber *)reactTag
viewName:(NSString *)viewName
rootTag:(nonnull NSNumber *)rootTag
props:(NSDictionary *)props
instanceHandle:(void *)instanceHandle
{
return @0;
return nil;
}
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, cloneNodeWithNewProps:(int)nodeID newProps:(NSDictionary *)newProps)
- (RCTShadowView *)cloneNode:(RCTShadowView *)node
{
return @0;
return nil;
}
- (RCTShadowView *)cloneNodeWithNewChildren:(RCTShadowView *)node
{
return nil;
}
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, cloneNodeWithNewChildrenAndProps:(int)nodeID newProps:(NSDictionary *)newProps)
- (RCTShadowView *)cloneNodeWithNewProps:(RCTShadowView *)node
newProps:(NSDictionary *)props
{
return @0;
return nil;
}
RCT_EXPORT_METHOD(appendChild:(int)parentNodeID child:(int)childNodeID)
- (RCTShadowView *)cloneNodeWithNewChildrenAndProps:(RCTShadowView *)node
newProps:(NSDictionary *)props
{
return nil;
}
- (void)appendChild:(RCTShadowView *)parentNode
childNode:(RCTShadowView *)childNode
{
}
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, createChildSet)
- (NSMutableArray<RCTShadowView *> *)createChildSet:(nonnull NSNumber *)rootTag
{
return @0;
return [NSMutableArray array];
}
RCT_EXPORT_METHOD(appendChildToSet:(int)childSetID child:(int)childNodeID)
- (void)appendChildToSet:(NSMutableArray<RCTShadowView *> *)childSet
childNode:(RCTShadowView *)childNode
{
[childSet addObject:childNode];
}
RCT_EXPORT_METHOD(completeRoot:(int)rootTag childSet:(int)childSetID)
- (void)completeRoot:(nonnull NSNumber *)rootTag
childSet:(NSArray<RCTShadowView *> *)childSet
{
}
@end