|
@@ -44,7 +44,7 @@
|
44
|
44
|
UIViewController<RNNRootViewProtocol> *result;
|
45
|
45
|
|
46
|
46
|
if (node.isComponent) {
|
47
|
|
- result = [self createComponent:node nativeComponent:NO];
|
|
47
|
+ result = [self createComponent:node];
|
48
|
48
|
}
|
49
|
49
|
|
50
|
50
|
else if (node.isStack) {
|
|
@@ -76,7 +76,7 @@
|
76
|
76
|
}
|
77
|
77
|
|
78
|
78
|
else if (node.isExternalComponent) {
|
79
|
|
- result = [self createComponent:node nativeComponent:YES];
|
|
79
|
+ result = [self createExternalComponent:node];
|
80
|
80
|
}
|
81
|
81
|
|
82
|
82
|
if (!result) {
|
|
@@ -88,13 +88,13 @@
|
88
|
88
|
return result;
|
89
|
89
|
}
|
90
|
90
|
|
91
|
|
-- (UIViewController<RNNRootViewProtocol> *)createComponent:(RNNLayoutNode*)node nativeComponent:(BOOL)nativeComponent {
|
|
91
|
+- (UIViewController<RNNRootViewProtocol> *)createComponent:(RNNLayoutNode*)node {
|
92
|
92
|
NSString* name = node.data[@"name"];
|
93
|
93
|
RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:_defaultOptionsDict];
|
94
|
94
|
[options mergeWith:node.data[@"options"]];
|
95
|
95
|
|
96
|
96
|
NSString* componentId = node.nodeId;
|
97
|
|
- RNNRootViewController* component = [[RNNRootViewController alloc] initWithName:name withOptions:options withComponentId:componentId rootViewCreator:_creator eventEmitter:_eventEmitter isExternalComponent:nativeComponent];
|
|
97
|
+ RNNRootViewController* component = [[RNNRootViewController alloc] initWithName:name withOptions:options withComponentId:componentId rootViewCreator:_creator eventEmitter:_eventEmitter isExternalComponent:NO];
|
98
|
98
|
if (!component.isCustomViewController) {
|
99
|
99
|
CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;
|
100
|
100
|
[_bridge.uiManager setAvailableSize:availableSize forRootView:component.view];
|
|
@@ -102,6 +102,25 @@
|
102
|
102
|
return component;
|
103
|
103
|
}
|
104
|
104
|
|
|
105
|
+- (UIViewController<RNNRootViewProtocol> *)createExternalComponent:(RNNLayoutNode*)node {
|
|
106
|
+ NSString* name = node.data[@"name"];
|
|
107
|
+
|
|
108
|
+ UIViewController* externalVC = [_store getExternalComponent:name];
|
|
109
|
+ RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:_defaultOptionsDict];
|
|
110
|
+ [options mergeWith:node.data[@"options"]];
|
|
111
|
+
|
|
112
|
+ NSString* componentId = node.nodeId;
|
|
113
|
+ RNNRootViewController* component = [[RNNRootViewController alloc] initWithName:name withOptions:options withComponentId:componentId rootViewCreator:_creator eventEmitter:_eventEmitter isExternalComponent:YES];
|
|
114
|
+
|
|
115
|
+ [component addChildViewController:externalVC];
|
|
116
|
+ component.view = [[UIView alloc] init];
|
|
117
|
+ component.view.backgroundColor = [UIColor whiteColor];
|
|
118
|
+ [component.view addSubview:externalVC.view];
|
|
119
|
+
|
|
120
|
+ return component;
|
|
121
|
+}
|
|
122
|
+
|
|
123
|
+
|
105
|
124
|
- (UIViewController<RNNRootViewProtocol> *)createStack:(RNNLayoutNode*)node {
|
106
|
125
|
RNNNavigationController* vc = [[RNNNavigationController alloc] init];
|
107
|
126
|
NSDictionary* options = node.data[@"options"];
|