Browse Source

RNNRootViewProtocol refactor

yogevbd 6 years ago
parent
commit
0aa0f22891

+ 2
- 1
lib/ios/RNNCommandsHandler.m View File

142
 	[self assertReady];
142
 	[self assertReady];
143
 	
143
 	
144
 	UIViewController<RNNRootViewProtocol> *newVC = [_controllerFactory createLayoutAndSaveToStore:layout];
144
 	UIViewController<RNNRootViewProtocol> *newVC = [_controllerFactory createLayoutAndSaveToStore:layout];
145
+	RNNNavigationOptions* options = [newVC getLeafViewController].options;
145
 	UIViewController *fromVC = [_store findComponentForId:componentId];
146
 	UIViewController *fromVC = [_store findComponentForId:componentId];
146
 	__weak typeof(RNNEventEmitter*) weakEventEmitter = _eventEmitter;
147
 	__weak typeof(RNNEventEmitter*) weakEventEmitter = _eventEmitter;
147
-	[_stackManager setStackRoot:newVC fromViewController:fromVC animated:newVC.options.animations.push.enable completion:^{
148
+	[_stackManager setStackRoot:newVC fromViewController:fromVC animated:options.animations.push.enable completion:^{
148
 		[weakEventEmitter sendOnNavigationCommandCompletion:setStackRoot params:@{@"componentId": componentId}];
149
 		[weakEventEmitter sendOnNavigationCommandCompletion:setStackRoot params:@{@"componentId": componentId}];
149
 		completion();
150
 		completion();
150
 	} rejection:rejection];
151
 	} rejection:rejection];

+ 6
- 7
lib/ios/RNNControllerFactory.m View File

1
 
1
 
2
 #import "RNNControllerFactory.h"
2
 #import "RNNControllerFactory.h"
3
 #import "RNNLayoutNode.h"
3
 #import "RNNLayoutNode.h"
4
-#import "RNNRootViewController.h"
5
 #import "RNNSplitViewController.h"
4
 #import "RNNSplitViewController.h"
6
 #import "RNNSplitViewOptions.h"
5
 #import "RNNSplitViewOptions.h"
7
 #import "RNNSideMenuController.h"
6
 #import "RNNSideMenuController.h"
104
 		CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;
103
 		CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;
105
 		[_bridge.uiManager setAvailableSize:availableSize forRootView:component.view];
104
 		[_bridge.uiManager setAvailableSize:availableSize forRootView:component.view];
106
 	}
105
 	}
107
-	return component;
106
+	return (UIViewController<RNNRootViewProtocol> *)component;
108
 }
107
 }
109
 
108
 
110
 - (UIViewController<RNNRootViewProtocol> *)createExternalComponent:(RNNLayoutNode*)node {
109
 - (UIViewController<RNNRootViewProtocol> *)createExternalComponent:(RNNLayoutNode*)node {
121
 	[component.view addSubview:externalVC.view];
120
 	[component.view addSubview:externalVC.view];
122
 	[externalVC didMoveToParentViewController:component];
121
 	[externalVC didMoveToParentViewController:component];
123
 	
122
 	
124
-	return component;
123
+	return (UIViewController<RNNRootViewProtocol> *)component;
125
 }
124
 }
126
 
125
 
127
 
126
 
134
 		[controllers addObject:[self fromTree:child]];
133
 		[controllers addObject:[self fromTree:child]];
135
 	}
134
 	}
136
 	[vc setViewControllers:controllers];
135
 	[vc setViewControllers:controllers];
137
-	[vc mergeOptions:options];
136
+	[vc.getLeafViewController mergeOptions:options];
138
 	
137
 	
139
 	return vc;
138
 	return vc;
140
 }
139
 }
152
 		[controllers addObject:childVc];
151
 		[controllers addObject:childVc];
153
 	}
152
 	}
154
 	[vc setViewControllers:controllers];
153
 	[vc setViewControllers:controllers];
155
-	[vc mergeOptions:options];
154
+	[vc.getLeafViewController mergeOptions:options];
156
 	
155
 	
157
 	return vc;
156
 	return vc;
158
 }
157
 }
163
 	NSMutableArray* controllers = [NSMutableArray new];
162
 	NSMutableArray* controllers = [NSMutableArray new];
164
 	for (NSDictionary *child in node.children) {
163
 	for (NSDictionary *child in node.children) {
165
 		RNNRootViewController* childVc = (RNNRootViewController*)[self fromTree:child];
164
 		RNNRootViewController* childVc = (RNNRootViewController*)[self fromTree:child];
166
-		childVc.topTabsViewController = vc;
165
+//		childVc.topTabsViewController = vc;
167
 		[controllers addObject:childVc];
166
 		[controllers addObject:childVc];
168
 		[_bridge.uiManager setAvailableSize:vc.contentView.bounds.size forRootView:childVc.view];
167
 		[_bridge.uiManager setAvailableSize:vc.contentView.bounds.size forRootView:childVc.view];
169
 	}
168
 	}
181
 		[childrenVCs addObject:vc];
180
 		[childrenVCs addObject:vc];
182
 	}
181
 	}
183
 	RNNSideMenuController *sideMenu = [[RNNSideMenuController alloc] initWithControllers:childrenVCs];
182
 	RNNSideMenuController *sideMenu = [[RNNSideMenuController alloc] initWithControllers:childrenVCs];
184
-	[sideMenu mergeOptions:[self createOptions:node.data[@"options"]]];
183
+	[sideMenu.getLeafViewController mergeOptions:[self createOptions:node.data[@"options"]]];
185
 	return sideMenu;
184
 	return sideMenu;
186
 }
185
 }
187
 
186
 

+ 13
- 10
lib/ios/RNNModalManager.m View File

14
 }
14
 }
15
 
15
 
16
 -(void)showModalAfterLoad:(NSDictionary*)notif {
16
 -(void)showModalAfterLoad:(NSDictionary*)notif {
17
-	RNNRootViewController *topVC = (RNNRootViewController*)[self topPresentedVC];
17
+	UIViewController<RNNRootViewProtocol>* topVC = (UIViewController<RNNRootViewProtocol>*)[self topPresentedVC];
18
 	topVC.definesPresentationContext = YES;
18
 	topVC.definesPresentationContext = YES;
19
-	
20
-	if (topVC.options.animations.showModal.hasCustomAnimation) {
19
+	RNNNavigationOptions* options = topVC.getLeafViewController.options;
20
+
21
+	if (options.animations.showModal.hasCustomAnimation) {
21
 		self.toVC.transitioningDelegate = topVC;
22
 		self.toVC.transitioningDelegate = topVC;
22
 	}
23
 	}
23
 	
24
 	
24
-	[topVC presentViewController:self.toVC animated:self.toVC.options.animations.showModal.enable completion:^{
25
+	[topVC presentViewController:self.toVC animated:options.animations.showModal.enable completion:^{
25
 		if (_completionBlock) {
26
 		if (_completionBlock) {
26
 			_completionBlock();
27
 			_completionBlock();
27
 			_completionBlock = nil;
28
 			_completionBlock = nil;
32
 
33
 
33
 -(void)showModal:(UIViewController *)viewController completion:(RNNTransitionCompletionBlock)completion {
34
 -(void)showModal:(UIViewController *)viewController completion:(RNNTransitionCompletionBlock)completion {
34
 	self.toVC = (UIViewController<RNNRootViewProtocol>*)viewController;
35
 	self.toVC = (UIViewController<RNNRootViewProtocol>*)viewController;
36
+	RNNNavigationOptions* options = self.toVC.getLeafViewController.options;
37
+
35
 	_completionBlock = completion;
38
 	_completionBlock = completion;
36
 	
39
 	
37
     if ([self.toVC respondsToSelector:@selector(applyModalOptions)]) {
40
     if ([self.toVC respondsToSelector:@selector(applyModalOptions)]) {
38
-        [self.toVC applyModalOptions];
41
+        [self.toVC.getLeafViewController applyModalOptions];
39
     }
42
     }
40
     
43
     
41
     if ([self.toVC respondsToSelector:@selector(isCustomViewController)] &&
44
     if ([self.toVC respondsToSelector:@selector(isCustomViewController)] &&
42
-        [self.toVC isCustomViewController]
45
+        [self.toVC.getLeafViewController isCustomViewController]
43
     ) {
46
     ) {
44
 		[self showModalAfterLoad:nil];
47
 		[self showModalAfterLoad:nil];
45
 	} else {
48
 	} else {
46
-		[self.toVC waitForReactViewRender:self.toVC.options.animations.showModal.waitForRender perform:^{
49
+		[self.toVC.getLeafViewController waitForReactViewRender:options.animations.showModal.waitForRender perform:^{
47
 			[self showModalAfterLoad:nil];
50
 			[self showModalAfterLoad:nil];
48
 		}];
51
 		}];
49
 	}
52
 	}
65
 
68
 
66
 -(void)removePendingNextModalIfOnTop {
69
 -(void)removePendingNextModalIfOnTop {
67
 	NSString *componentId = [[_store pendingModalIdsToDismiss] lastObject];
70
 	NSString *componentId = [[_store pendingModalIdsToDismiss] lastObject];
68
-
69
 	UIViewController<RNNRootViewProtocol> *modalToDismiss = (UIViewController<RNNRootViewProtocol>*)[_store findComponentForId:componentId];
71
 	UIViewController<RNNRootViewProtocol> *modalToDismiss = (UIViewController<RNNRootViewProtocol>*)[_store findComponentForId:componentId];
72
+	RNNNavigationOptions* options = modalToDismiss.getLeafViewController.options;
70
 
73
 
71
 	if(!modalToDismiss) {
74
 	if(!modalToDismiss) {
72
 		return;
75
 		return;
74
 
77
 
75
 	UIViewController* topPresentedVC = [self topPresentedVC];
78
 	UIViewController* topPresentedVC = [self topPresentedVC];
76
 
79
 
77
-	if ([modalToDismiss.options.animations.showModal hasCustomAnimation]) {
80
+	if ([options.animations.showModal hasCustomAnimation]) {
78
 		modalToDismiss.transitioningDelegate = modalToDismiss;
81
 		modalToDismiss.transitioningDelegate = modalToDismiss;
79
 	}
82
 	}
80
 
83
 
81
 	if (modalToDismiss == topPresentedVC || [[topPresentedVC childViewControllers] containsObject:modalToDismiss]) {
84
 	if (modalToDismiss == topPresentedVC || [[topPresentedVC childViewControllers] containsObject:modalToDismiss]) {
82
-		[modalToDismiss dismissViewControllerAnimated:modalToDismiss.options.animations.dismissModal.enable completion:^{
85
+		[modalToDismiss dismissViewControllerAnimated:options.animations.dismissModal.enable completion:^{
83
 			[[_store pendingModalIdsToDismiss] removeObject:componentId];
86
 			[[_store pendingModalIdsToDismiss] removeObject:componentId];
84
 			[_store removeComponent:componentId];
87
 			[_store removeComponent:componentId];
85
 			[self removePendingNextModalIfOnTop];
88
 			[self removePendingNextModalIfOnTop];

+ 2
- 22
lib/ios/RNNNavigationController.m View File

12
 	return self;
12
 	return self;
13
 }
13
 }
14
 
14
 
15
-- (BOOL)isCustomViewController {
16
-	return [self.getLeafViewController isCustomViewController];
17
-}
18
-
19
-- (void)mergeOptions:(RNNOptions *)options {
20
-	[self.getLeafViewController mergeOptions:options];
21
-}
22
-
23
 - (UIStatusBarStyle)preferredStatusBarStyle {
15
 - (UIStatusBarStyle)preferredStatusBarStyle {
24
 	return self.getLeafViewController.preferredStatusBarStyle;
16
 	return self.getLeafViewController.preferredStatusBarStyle;
25
 }
17
 }
28
 	return self.getLeafViewController.modalPresentationStyle;
20
 	return self.getLeafViewController.modalPresentationStyle;
29
 }
21
 }
30
 
22
 
31
-- (void)applyModalOptions {
32
-	[self.getLeafViewController applyModalOptions];
33
-}
34
-
35
 - (UIViewController *)popViewControllerAnimated:(BOOL)animated {
23
 - (UIViewController *)popViewControllerAnimated:(BOOL)animated {
36
 	return [super popViewControllerAnimated:animated];
24
 	return [super popViewControllerAnimated:animated];
37
 }
25
 }
41
 }
29
 }
42
 
30
 
43
 - (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
31
 - (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
44
-	return [[RNNModalAnimation alloc] initWithScreenTransition:self.options.animations.showModal isDismiss:NO];
32
+	return [[RNNModalAnimation alloc] initWithScreenTransition:self.getLeafViewController.options.animations.showModal isDismiss:NO];
45
 }
33
 }
46
 
34
 
47
 - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
35
 - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
48
-	return [[RNNModalAnimation alloc] initWithScreenTransition:self.options.animations.dismissModal isDismiss:YES];
49
-}
50
-
51
-- (RNNNavigationOptions *)options {
52
-	return self.getLeafViewController.options;
36
+	return [[RNNModalAnimation alloc] initWithScreenTransition:self.getLeafViewController.options.animations.dismissModal isDismiss:YES];
53
 }
37
 }
54
 
38
 
55
 - (UIViewController *)getLeafViewController {
39
 - (UIViewController *)getLeafViewController {
56
 	return ((UIViewController<RNNRootViewProtocol>*)self.topViewController);
40
 	return ((UIViewController<RNNRootViewProtocol>*)self.topViewController);
57
 }
41
 }
58
 
42
 
59
-- (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock {
60
-	[self.getLeafViewController waitForReactViewRender:wait perform:readyBlock];
61
-}
62
-
63
 - (UIViewController *)childViewControllerForStatusBarStyle {
43
 - (UIViewController *)childViewControllerForStatusBarStyle {
64
 	return self.topViewController;
44
 	return self.topViewController;
65
 }
45
 }

+ 1
- 1
lib/ios/RNNNavigationOptions.m View File

54
 	[self.layout applyOn:viewController];
54
 	[self.layout applyOn:viewController];
55
 	[self applyOtherOptionsOn:viewController];
55
 	[self applyOtherOptionsOn:viewController];
56
 	
56
 	
57
-	[viewController optionsUpdated];
57
+	[viewController.getLeafViewController optionsUpdated];
58
 }
58
 }
59
 
59
 
60
 - (void)applyOtherOptionsOn:(UIViewController*)viewController {
60
 - (void)applyOtherOptionsOn:(UIViewController*)viewController {

+ 3
- 0
lib/ios/RNNOverlayManager.h View File

1
 #import <Foundation/Foundation.h>
1
 #import <Foundation/Foundation.h>
2
 #import <UIKit/UIKit.h>
2
 #import <UIKit/UIKit.h>
3
 #import "RNNStore.h"
3
 #import "RNNStore.h"
4
+#import "RNNOverlayWindow.h"
4
 
5
 
5
 @interface RNNOverlayManager : NSObject
6
 @interface RNNOverlayManager : NSObject
6
 
7
 
9
 - (void)showOverlay:(UIViewController*)viewController completion:(RNNTransitionCompletionBlock)completion;
10
 - (void)showOverlay:(UIViewController*)viewController completion:(RNNTransitionCompletionBlock)completion;
10
 - (void)dismissOverlay:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion rejection:(RNNTransitionRejectionBlock)reject;
11
 - (void)dismissOverlay:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion rejection:(RNNTransitionRejectionBlock)reject;
11
 
12
 
13
+@property (nonatomic, retain) RNNOverlayWindow *overlayWindow;
14
+
12
 @end
15
 @end

+ 11
- 9
lib/ios/RNNRootViewController.h View File

1
-
2
 #import <Foundation/Foundation.h>
1
 #import <Foundation/Foundation.h>
3
 #import <UIKit/UIKit.h>
2
 #import <UIKit/UIKit.h>
4
 #import "RNNLayoutNode.h"
3
 #import "RNNLayoutNode.h"
6
 #import "RNNEventEmitter.h"
5
 #import "RNNEventEmitter.h"
7
 #import "RNNNavigationOptions.h"
6
 #import "RNNNavigationOptions.h"
8
 #import "RNNAnimator.h"
7
 #import "RNNAnimator.h"
9
-#import "RNNTopTabsViewController.h"
10
-#import "RNNRootViewProtocol.h"
11
 
8
 
12
-@class RNNRootViewController;
9
+typedef void (^RNNReactViewReadyCompletionBlock)(void);
13
 
10
 
14
-@interface RNNRootViewController : UIViewController	<RNNRootViewProtocol, UIViewControllerPreviewingDelegate, UISearchResultsUpdating, UISearchBarDelegate>
11
+@interface RNNRootViewController : UIViewController	<UIViewControllerPreviewingDelegate, UISearchResultsUpdating, UISearchBarDelegate, UINavigationControllerDelegate, UISplitViewControllerDelegate>
15
 
12
 
16
 @property (nonatomic, strong) RNNNavigationOptions* options;
13
 @property (nonatomic, strong) RNNNavigationOptions* options;
17
 @property (nonatomic, strong) RNNEventEmitter *eventEmitter;
14
 @property (nonatomic, strong) RNNEventEmitter *eventEmitter;
18
 @property (nonatomic, strong) NSString* componentId;
15
 @property (nonatomic, strong) NSString* componentId;
19
-@property (nonatomic, strong) RNNTopTabsViewController* topTabsViewController;
20
 @property (nonatomic) id<RNNRootViewCreator> creator;
16
 @property (nonatomic) id<RNNRootViewCreator> creator;
21
 @property (nonatomic, strong) RNNAnimator* animator;
17
 @property (nonatomic, strong) RNNAnimator* animator;
22
 @property (nonatomic, strong) UIViewController* previewController;
18
 @property (nonatomic, strong) UIViewController* previewController;
23
 
19
 
24
 
20
 
25
--(instancetype)initWithName:(NSString*)name
21
+- (instancetype)initWithName:(NSString*)name
26
 				withOptions:(RNNNavigationOptions*)options
22
 				withOptions:(RNNNavigationOptions*)options
27
 			withComponentId:(NSString*)componentId
23
 			withComponentId:(NSString*)componentId
28
 			rootViewCreator:(id<RNNRootViewCreator>)creator
24
 			rootViewCreator:(id<RNNRootViewCreator>)creator
29
 			   eventEmitter:(RNNEventEmitter*)eventEmitter
25
 			   eventEmitter:(RNNEventEmitter*)eventEmitter
30
 		  isExternalComponent:(BOOL)isExternalComponent;
26
 		  isExternalComponent:(BOOL)isExternalComponent;
31
 
27
 
32
--(void)applyTabBarItem;
33
--(void)applyTopTabsOptions;
28
+- (void)applyTabBarItem;
29
+- (void)applyTopTabsOptions;
30
+- (BOOL)isCustomViewController;
31
+- (BOOL)isCustomTransitioned;
32
+- (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock;
33
+- (void)mergeOptions:(RNNOptions*)options;
34
+- (void)applyModalOptions;
35
+- (void)optionsUpdated;
34
 
36
 
35
 @end
37
 @end

+ 0
- 1
lib/ios/RNNRootViewController.m View File

60
 -(void)viewWillAppear:(BOOL)animated{
60
 -(void)viewWillAppear:(BOOL)animated{
61
 	[super viewWillAppear:animated];
61
 	[super viewWillAppear:animated];
62
 	[self.options applyOn:self];
62
 	[self.options applyOn:self];
63
-	[self optionsUpdated];
64
 }
63
 }
65
 
64
 
66
 -(void)viewDidAppear:(BOOL)animated {
65
 -(void)viewDidAppear:(BOOL)animated {

+ 3
- 10
lib/ios/RNNRootViewProtocol.h View File

1
 #import "RNNNavigationOptions.h"
1
 #import "RNNNavigationOptions.h"
2
-typedef void (^RNNReactViewReadyCompletionBlock)(void);
2
+#import "RNNRootViewController.h"
3
 
3
 
4
 @protocol RNNRootViewProtocol <NSObject, UINavigationControllerDelegate, UIViewControllerTransitioningDelegate, UISplitViewControllerDelegate>
4
 @protocol RNNRootViewProtocol <NSObject, UINavigationControllerDelegate, UIViewControllerTransitioningDelegate, UISplitViewControllerDelegate>
5
 
5
 
6
 @optional
6
 @optional
7
-- (void)mergeOptions:(RNNOptions*)options;
8
-- (BOOL)isCustomViewController;
7
+
9
 - (void)performOnRotation:(void (^)(void))block;
8
 - (void)performOnRotation:(void (^)(void))block;
10
-- (void)optionsUpdated;
11
-- (void)applyModalOptions;
12
-- (BOOL)isCustomTransitioned;
13
-- (RNNNavigationOptions*)options;
14
 
9
 
15
 @required
10
 @required
16
-- (NSString *)componentId;
17
-- (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock;
18
-- (UIViewController<RNNRootViewProtocol> *)getLeafViewController;
11
+- (RNNRootViewController *)getLeafViewController;
19
 
12
 
20
 @end
13
 @end
21
 
14
 

+ 2
- 14
lib/ios/RNNSideMenuChildVC.m View File

31
 	return self;
31
 	return self;
32
 }
32
 }
33
 
33
 
34
-- (void)mergeOptions:(RNNOptions *)options {
35
-	[self.child mergeOptions:options];
36
-}
37
-
38
-- (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock {
39
-	[self.child waitForReactViewRender:wait perform:readyBlock];
40
-}
41
-
42
-- (UIViewController *)getLeafViewController {
43
-	return self.child;
34
+- (RNNRootViewController *)getLeafViewController {
35
+	return [self.child getLeafViewController];
44
 }
36
 }
45
 
37
 
46
 - (UIStatusBarStyle)preferredStatusBarStyle {
38
 - (UIStatusBarStyle)preferredStatusBarStyle {
47
 	return self.child.preferredStatusBarStyle;
39
 	return self.child.preferredStatusBarStyle;
48
 }
40
 }
49
 
41
 
50
-- (NSString *)componentId {
51
-	return _child.componentId;
52
-}
53
-
54
 @end
42
 @end

+ 3
- 11
lib/ios/RNNSideMenuController.m View File

89
 	}
89
 	}
90
 }
90
 }
91
 
91
 
92
-- (UIViewController *)getLeafViewController {
93
-	return self.center;
92
+- (RNNRootViewController *)getLeafViewController {
93
+	return [self.center getLeafViewController];
94
 }
94
 }
95
 
95
 
96
 - (void)mergeOptions:(RNNOptions *)options {
96
 - (void)mergeOptions:(RNNOptions *)options {
97
-	[self.center mergeOptions:options];
98
-}
99
-
100
-- (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock {
101
-	[self.center waitForReactViewRender:wait perform:readyBlock];
102
-}
103
-
104
-- (NSString *)componentId {
105
-	return _center.componentId;
97
+	[self.center.getLeafViewController mergeOptions:options];
106
 }
98
 }
107
 
99
 
108
 @end
100
 @end

+ 0
- 6
lib/ios/RNNSplitViewController.m View File

1
-
2
-#import "RNNRootViewController.h"
3
 #import "RNNSplitViewController.h"
1
 #import "RNNSplitViewController.h"
4
 
2
 
5
 @interface RNNSplitViewController()
3
 @interface RNNSplitViewController()
27
 -(void)viewWillAppear:(BOOL)animated{
25
 -(void)viewWillAppear:(BOOL)animated{
28
 	[super viewWillAppear:animated];
26
 	[super viewWillAppear:animated];
29
 	[self.options applyOn:self];
27
 	[self.options applyOn:self];
30
-	[self optionsUpdated];
31
-}
32
-
33
-- (void)optionsUpdated {
34
 }
28
 }
35
 
29
 
36
 - (UIViewController *)getLeafViewController {
30
 - (UIViewController *)getLeafViewController {

+ 1
- 1
lib/ios/RNNStore.h View File

1
 
1
 
2
 #import <Foundation/Foundation.h>
2
 #import <Foundation/Foundation.h>
3
 #import <UIKit/UIKit.h>
3
 #import <UIKit/UIKit.h>
4
-#import "RNNRootViewController.h"
4
+#import "RNNRootViewProtocol.h"
5
 #import "ReactNativeNavigation.h"
5
 #import "ReactNativeNavigation.h"
6
 
6
 
7
 typedef void (^RNNTransitionCompletionBlock)(void);
7
 typedef void (^RNNTransitionCompletionBlock)(void);

+ 1
- 1
lib/ios/RNNStore.m View File

1
 
1
 
2
 #import "RNNStore.h"
2
 #import "RNNStore.h"
3
-#import "RNNRootViewController.h"
3
+
4
 @interface RNNStore ()
4
 @interface RNNStore ()
5
 
5
 
6
 @end
6
 @end

+ 3
- 15
lib/ios/RNNTabBarController.m View File

1
 
1
 
2
 #import "RNNTabBarController.h"
2
 #import "RNNTabBarController.h"
3
-#import "RNNRootViewController.h"
3
+
4
 #define kTabBarHiddenDuration 0.3
4
 #define kTabBarHiddenDuration 0.3
5
 
5
 
6
 @implementation RNNTabBarController {
6
 @implementation RNNTabBarController {
42
 }
42
 }
43
 
43
 
44
 - (void)mergeOptions:(RNNOptions *)options {
44
 - (void)mergeOptions:(RNNOptions *)options {
45
-	[((UIViewController<RNNRootViewProtocol>*)self.selectedViewController) mergeOptions:options];
46
-}
47
-
48
-- (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock {
49
-	[((UIViewController<RNNRootViewProtocol>*)self.selectedViewController) waitForReactViewRender:wait perform:readyBlock];
50
-}
51
-
52
-- (RNNNavigationOptions *)options {
53
-	return [((UIViewController<RNNRootViewProtocol>*)self.selectedViewController) options];
45
+	[self.getLeafViewController mergeOptions:options];
54
 }
46
 }
55
 
47
 
56
 - (UIViewController *)getLeafViewController {
48
 - (UIViewController *)getLeafViewController {
57
-	return ((UIViewController<RNNRootViewProtocol>*)self.selectedViewController);
58
-}
59
-
60
-- (NSString *)componentId {
61
-	return ((UIViewController<RNNRootViewProtocol>*)self.selectedViewController).componentId;
49
+	return ((UIViewController<RNNRootViewProtocol>*)self.selectedViewController).getLeafViewController;
62
 }
50
 }
63
 
51
 
64
 - (UIStatusBarStyle)preferredStatusBarStyle {
52
 - (UIStatusBarStyle)preferredStatusBarStyle {

+ 1
- 1
lib/ios/RNNTopTabOptions.m View File

5
 
5
 
6
 - (void)applyOn:(RNNRootViewController*)viewController {
6
 - (void)applyOn:(RNNRootViewController*)viewController {
7
 	if (self.title) {
7
 	if (self.title) {
8
-		[viewController.topTabsViewController viewController:viewController changedTitle:self.title];
8
+//		[viewController.topTabsViewController viewController:viewController changedTitle:self.title];
9
 	}
9
 	}
10
 }
10
 }
11
 
11
 

+ 0
- 9
lib/ios/RNNTopTabsViewController.m View File

1
 #import "RNNTopTabsViewController.h"
1
 #import "RNNTopTabsViewController.h"
2
 #import "RNNSegmentedControl.h"
2
 #import "RNNSegmentedControl.h"
3
-#import "RNNRootViewController.h"
4
 #import "ReactNativeNavigation.h"
3
 #import "ReactNativeNavigation.h"
5
 
4
 
6
 @interface RNNTopTabsViewController () {
5
 @interface RNNTopTabsViewController () {
72
     [super viewDidLoad];
71
     [super viewDidLoad];
73
 }
72
 }
74
 
73
 
75
-- (NSString *)componentId {
76
-	return _currentViewController.componentId;
77
-}
78
-
79
 #pragma mark RNNRootViewProtocol
74
 #pragma mark RNNRootViewProtocol
80
 
75
 
81
-- (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock {
82
-	[_currentViewController waitForReactViewRender:wait perform:readyBlock];
83
-}
84
-
85
 - (UIViewController *)getLeafViewController {
76
 - (UIViewController *)getLeafViewController {
86
 	return _currentViewController;
77
 	return _currentViewController;
87
 }
78
 }