Browse Source

show modal with stack holding external viewController

yogevbd 6 years ago
parent
commit
51312b165a
2 changed files with 10 additions and 1 deletions
  1. 6
    1
      lib/ios/RNNModalManager.m
  2. 4
    0
      lib/ios/RNNNavigationController.m

+ 6
- 1
lib/ios/RNNModalManager.m View File

36
 -(void)showModal:(UIViewController *)viewController completion:(RNNTransitionCompletionBlock)completion {
36
 -(void)showModal:(UIViewController *)viewController completion:(RNNTransitionCompletionBlock)completion {
37
 	self.toVC = (UIViewController<RNNRootViewProtocol>*)viewController;
37
 	self.toVC = (UIViewController<RNNRootViewProtocol>*)viewController;
38
 	_completionBlock = completion;
38
 	_completionBlock = completion;
39
-	[self waitForContentToAppearAndThen:@selector(showModalAfterLoad:)];
39
+	
40
+	if ([self.toVC isCustomViewController]) {
41
+		[self showModalAfterLoad:nil];
42
+	} else {
43
+		[self waitForContentToAppearAndThen:@selector(showModalAfterLoad:)];
44
+	}
40
 }
45
 }
41
 
46
 
42
 -(void)dismissModal:(NSString *)componentId {
47
 -(void)dismissModal:(NSString *)componentId {

+ 4
- 0
lib/ios/RNNNavigationController.m View File

12
 	return NO;
12
 	return NO;
13
 }
13
 }
14
 
14
 
15
+- (BOOL)isCustomViewController {
16
+	return [((UIViewController<RNNRootViewProtocol>*)self.topViewController) isCustomViewController];
17
+}
18
+
15
 - (BOOL)isAnimated {
19
 - (BOOL)isAnimated {
16
 	UIViewController<RNNRootViewProtocol>* rootVC = (UIViewController<RNNRootViewProtocol>*) self.topViewController;
20
 	UIViewController<RNNRootViewProtocol>* rootVC = (UIViewController<RNNRootViewProtocol>*) self.topViewController;
17
 	return rootVC.isAnimated;
21
 	return rootVC.isAnimated;