|
@@ -49,14 +49,25 @@ RCT_EXPORT_METHOD(showModal:(NSDictionary*)layout)
|
49
|
49
|
RNNControllerFactory *factory = [[RNNControllerFactory alloc] initWithRootViewCreator:[RNNReactRootViewCreator new] store:[RNN instance].store];
|
50
|
50
|
UIViewController *newVc = [factory createLayoutAndSaveToStore:layout];
|
51
|
51
|
|
52
|
|
- [UIApplication.sharedApplication.delegate.window.rootViewController presentViewController:newVc animated:YES completion:^{
|
|
52
|
+ UIViewController *root = UIApplication.sharedApplication.delegate.window.rootViewController;
|
|
53
|
+ while(root.presentedViewController) {
|
|
54
|
+ root = root.presentedViewController;
|
|
55
|
+ }
|
|
56
|
+
|
|
57
|
+ [root presentViewController:newVc animated:YES completion:^{
|
53
|
58
|
|
54
|
59
|
}];
|
55
|
60
|
}
|
56
|
61
|
|
57
|
62
|
RCT_EXPORT_METHOD(dismissModal:(NSString*)containerId)
|
58
|
63
|
{
|
59
|
|
- [UIApplication.sharedApplication.delegate.window.rootViewController dismissViewControllerAnimated:YES completion:^{
|
|
64
|
+ UIViewController *root = UIApplication.sharedApplication.delegate.window.rootViewController;
|
|
65
|
+ while(root.presentedViewController) {
|
|
66
|
+ root = root.presentedViewController;
|
|
67
|
+ }
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+ [root dismissViewControllerAnimated:YES completion:^{
|
60
|
71
|
|
61
|
72
|
}];
|
62
|
73
|
}
|