瀏覽代碼

ios - added modal - not completed

Ran Greenberg 8 年之前
父節點
當前提交
e103d3c00c
共有 1 個檔案被更改,包括 11 行新增0 行删除
  1. 11
    0
      ios/RNNBridgeModule.m

+ 11
- 0
ios/RNNBridgeModule.m 查看文件

@@ -43,6 +43,17 @@ RCT_EXPORT_METHOD(pop:(NSString*)containerId)
43 43
 	[[RNN instance].store removeContainer:containerId];
44 44
 }
45 45
 
46
+RCT_EXPORT_METHOD(showModal:(NSDictionary*)layout)
47
+{
48
+	[self assertReady];
49
+	RNNControllerFactory *factory = [[RNNControllerFactory alloc] initWithRootViewCreator:[RNNReactRootViewCreator new] store:[RNN instance].store];
50
+	UIViewController *newVc = [factory createLayout:layout];
51
+	
52
+	[UIApplication.sharedApplication.delegate.window.rootViewController presentViewController:newVc animated:YES completion:^{
53
+		
54
+	}];
55
+}
56
+
46 57
 - (void)assertReady
47 58
 {
48 59
 	if (![RNN instance].isReadyToReceiveCommands) {