Browse Source

ios - added modal - not completed

Ran Greenberg 7 years ago
parent
commit
e103d3c00c
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      ios/RNNBridgeModule.m

+ 11
- 0
ios/RNNBridgeModule.m View File

@@ -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) {