Browse Source

Fixed options merging issues, removed optionsResolver (#4100)

Yogev Ben David 6 years ago
parent
commit
c64dc49901
No account linked to committer's email address

+ 8
- 7
lib/ios/RNNCommandsHandler.m View File

67
 - (void)mergeOptions:(NSString*)componentId options:(NSDictionary*)mergeOptions completion:(RNNTransitionCompletionBlock)completion {
67
 - (void)mergeOptions:(NSString*)componentId options:(NSDictionary*)mergeOptions completion:(RNNTransitionCompletionBlock)completion {
68
 	[self assertReady];
68
 	[self assertReady];
69
 	
69
 	
70
-	UIViewController* vc = [_store findComponentForId:componentId];
70
+	UIViewController<RNNLayoutProtocol>* vc = (UIViewController<RNNLayoutProtocol>*)[_store findComponentForId:componentId];
71
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
71
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
72
-	
73
-	while (vc != nil) {
74
-		if ([vc conformsToProtocol:@protocol(RNNLayoutProtocol)]) {
75
-			[(UIViewController<RNNLayoutProtocol>*)vc mergeOptions:options];
76
-		}
77
-		vc = vc.parentViewController;
72
+	if ([vc conformsToProtocol:@protocol(RNNLayoutProtocol)] || [vc isKindOfClass:[RNNRootViewController class]]) {
73
+		[CATransaction begin];
74
+		[CATransaction setCompletionBlock:completion];
75
+		
76
+		[vc.getLeafViewController mergeAndPresentOptions:options];
77
+		
78
+		[CATransaction commit];
78
 	}
79
 	}
79
 }
80
 }
80
 
81
 

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

131
 	RNNNavigationControllerPresenter* presenter = [[RNNNavigationControllerPresenter alloc] init];
131
 	RNNNavigationControllerPresenter* presenter = [[RNNNavigationControllerPresenter alloc] init];
132
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
132
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
133
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
133
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
134
-	RNNParentOptionsResolver* optionsResolver = [[RNNParentOptionsResolver alloc] init];
135
 	
134
 	
136
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
135
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
137
 	
136
 	
138
-	RNNNavigationController* stack = [[RNNNavigationController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter];
137
+	RNNNavigationController* stack = [[RNNNavigationController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter];
139
 	
138
 	
140
 	return stack;
139
 	return stack;
141
 }
140
 }
144
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
143
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
145
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
144
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
146
 	RNNTabBarPresenter* presenter = [[RNNTabBarPresenter alloc] init];
145
 	RNNTabBarPresenter* presenter = [[RNNTabBarPresenter alloc] init];
147
-	RNNParentOptionsResolver* optionsResolver = [[RNNParentOptionsResolver alloc] init];
148
 
146
 
149
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
147
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
150
 	
148
 	
151
-	RNNTabBarController* tabsController = [[RNNTabBarController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter eventEmitter:_eventEmitter];
149
+	RNNTabBarController* tabsController = [[RNNTabBarController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter eventEmitter:_eventEmitter];
152
 	
150
 	
153
 	return tabsController;
151
 	return tabsController;
154
 }
152
 }
157
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
155
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
158
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
156
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
159
 	RNNBasePresenter* presenter = [[RNNBasePresenter alloc] init];
157
 	RNNBasePresenter* presenter = [[RNNBasePresenter alloc] init];
160
-	RNNParentOptionsResolver* optionsResolver = [[RNNParentOptionsResolver alloc] init];
161
 
158
 
162
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
159
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
163
 	
160
 	
164
-	RNNTopTabsViewController* topTabsController = [[RNNTopTabsViewController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter];
161
+	RNNTopTabsViewController* topTabsController = [[RNNTopTabsViewController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter];
165
 	
162
 	
166
 	return topTabsController;
163
 	return topTabsController;
167
 }
164
 }
170
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
167
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
171
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
168
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
172
 	RNNBasePresenter* presenter = [[RNNBasePresenter alloc] init];
169
 	RNNBasePresenter* presenter = [[RNNBasePresenter alloc] init];
173
-	RNNParentOptionsResolver* optionsResolver = [[RNNParentOptionsResolver alloc] init];
174
 
170
 
175
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
171
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
176
 	
172
 	
177
-	RNNSideMenuController *sideMenu = [[RNNSideMenuController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter];
173
+	RNNSideMenuController *sideMenu = [[RNNSideMenuController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter];
178
 	
174
 	
179
 	return sideMenu;
175
 	return sideMenu;
180
 }
176
 }
184
 	UIViewController<RNNParentProtocol>* childVc = [self fromTree:node.children[0]];
180
 	UIViewController<RNNParentProtocol>* childVc = [self fromTree:node.children[0]];
185
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
181
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
186
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
182
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
187
-	RNNParentOptionsResolver* optionsResolver = [[RNNParentOptionsResolver alloc] init];
188
 
183
 
189
-	RNNSideMenuChildVC *sideMenuChild = [[RNNSideMenuChildVC alloc] initWithLayoutInfo:layoutInfo childViewControllers:@[childVc] options:options optionsResolver:optionsResolver presenter:[[RNNBasePresenter alloc] init] type:type];
184
+	RNNSideMenuChildVC *sideMenuChild = [[RNNSideMenuChildVC alloc] initWithLayoutInfo:layoutInfo childViewControllers:@[childVc] options:options presenter:[[RNNBasePresenter alloc] init] type:type];
190
 	
185
 	
191
 	return sideMenuChild;
186
 	return sideMenuChild;
192
 }
187
 }
195
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
190
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
196
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
191
 	RNNNavigationOptions* options = [_optionsManager createOptions:node.data[@"options"]];
197
 	RNNBasePresenter* presenter = [[RNNBasePresenter alloc] init];
192
 	RNNBasePresenter* presenter = [[RNNBasePresenter alloc] init];
198
-	RNNParentOptionsResolver* optionsResolver = [[RNNParentOptionsResolver alloc] init];
199
 
193
 
200
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
194
 	NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node];
201
 
195
 
202
-	RNNSplitViewController* splitViewController = [[RNNSplitViewController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter];
196
+	RNNSplitViewController* splitViewController = [[RNNSplitViewController alloc] initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter];
203
 
197
 
204
 	return splitViewController;
198
 	return splitViewController;
205
 }
199
 }

+ 2
- 1
lib/ios/RNNLayoutProtocol.h View File

1
 #import "RNNLayoutInfo.h"
1
 #import "RNNLayoutInfo.h"
2
 #import "RNNBasePresenter.h"
2
 #import "RNNBasePresenter.h"
3
+#import "RNNLeafProtocol.h"
3
 
4
 
4
 @protocol RNNLayoutProtocol <NSObject, UINavigationControllerDelegate, UIViewControllerTransitioningDelegate, UISplitViewControllerDelegate>
5
 @protocol RNNLayoutProtocol <NSObject, UINavigationControllerDelegate, UIViewControllerTransitioningDelegate, UISplitViewControllerDelegate>
5
 
6
 
9
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
10
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
10
 @property (nonatomic, strong) RNNNavigationOptions* options;
11
 @property (nonatomic, strong) RNNNavigationOptions* options;
11
 
12
 
12
-- (void)mergeOptions:(RNNNavigationOptions *)options;
13
+- (UIViewController<RNNLeafProtocol, RNNLayoutProtocol> *)getLeafViewController;
13
 
14
 
14
 @end
15
 @end

+ 3
- 4
lib/ios/RNNLeafProtocol.h View File

1
-#import "RNNLayoutProtocol.h"
2
 
1
 
3
 typedef void (^RNNReactViewReadyCompletionBlock)(void);
2
 typedef void (^RNNReactViewReadyCompletionBlock)(void);
4
 
3
 
5
-@protocol RNNLeafProtocol <RNNLayoutProtocol>
4
+@protocol RNNLeafProtocol <NSObject>
6
 
5
 
7
 - (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock;
6
 - (void)waitForReactViewRender:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock;
8
 
7
 
9
-- (UIViewController<RNNLeafProtocol> *)getLeafViewController;
10
-
11
 - (void)bindViewController:(UIViewController *)viewController;
8
 - (void)bindViewController:(UIViewController *)viewController;
12
 
9
 
10
+- (void)mergeAndPresentOptions:(RNNNavigationOptions *)newOptions;
11
+
13
 @end
12
 @end

+ 0
- 2
lib/ios/RNNNavigationController.h View File

1
 #import <UIKit/UIKit.h>
1
 #import <UIKit/UIKit.h>
2
 #import "RNNParentProtocol.h"
2
 #import "RNNParentProtocol.h"
3
 #import "RNNNavigationControllerPresenter.h"
3
 #import "RNNNavigationControllerPresenter.h"
4
-#import "RNNParentOptionsResolver.h"
5
 
4
 
6
 @interface RNNNavigationController : UINavigationController <RNNParentProtocol>
5
 @interface RNNNavigationController : UINavigationController <RNNParentProtocol>
7
 
6
 
8
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
7
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
9
 @property (nonatomic, retain) RNNNavigationControllerPresenter* presenter;
8
 @property (nonatomic, retain) RNNNavigationControllerPresenter* presenter;
10
 @property (nonatomic, strong) RNNNavigationOptions* options;
9
 @property (nonatomic, strong) RNNNavigationOptions* options;
11
-@property (nonatomic, strong) RNNParentOptionsResolver* optionsResolver;
12
 
10
 
13
 @end
11
 @end

+ 1
- 13
lib/ios/RNNNavigationController.m View File

5
 
5
 
6
 @implementation RNNNavigationController
6
 @implementation RNNNavigationController
7
 
7
 
8
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNNavigationControllerPresenter *)presenter {
8
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNNavigationControllerPresenter *)presenter {
9
 	self = [super init];
9
 	self = [super init];
10
 
10
 
11
 	self.presenter = presenter;
11
 	self.presenter = presenter;
12
 	self.options = options;
12
 	self.options = options;
13
-	self.optionsResolver = optionsResolver;
14
 	self.layoutInfo = layoutInfo;
13
 	self.layoutInfo = layoutInfo;
15
 	
14
 	
16
 	[self setViewControllers:childViewControllers];
15
 	[self setViewControllers:childViewControllers];
62
 	return self.topViewController;
61
 	return self.topViewController;
63
 }
62
 }
64
 
63
 
65
-- (void)viewDidLoad {
66
-	[super viewDidLoad];
67
-	[_presenter present:self.options onViewControllerDidLoad:self];
68
-}
69
-
70
 - (void)willMoveToParentViewController:(UIViewController *)parent {
64
 - (void)willMoveToParentViewController:(UIViewController *)parent {
71
-	[_optionsResolver resolve:self with:self.childViewControllers];
72
 	[_presenter present:self.options onViewControllerDidLoad:self];
65
 	[_presenter present:self.options onViewControllerDidLoad:self];
73
 }
66
 }
74
 
67
 
75
-- (void)mergeOptions:(RNNNavigationOptions *)options {
76
-	[self.options mergeOptions:options overrideOptions:YES];
77
-	[self.presenter present:self.options onViewControllerWillAppear:self];
78
-}
79
-
80
 
68
 
81
 @end
69
 @end

+ 18
- 14
lib/ios/RNNNavigationOptions.m View File

19
 	[self.overlay applyOn:viewController];
19
 	[self.overlay applyOn:viewController];
20
 	[self.statusBar applyOn:viewController];
20
 	[self.statusBar applyOn:viewController];
21
 	[self.layout applyOn:viewController];
21
 	[self.layout applyOn:viewController];
22
-	[self applyOtherOptions:self on:viewController];
22
+	
23
+	[self applyOtherOptionsOn:viewController];
24
+	
25
+	[self applyOnNavigationController:viewController.navigationController];
26
+	[self applyOnTabBarController:viewController.tabBarController];
23
 }
27
 }
24
 
28
 
25
 - (void)applyOnNavigationController:(UINavigationController *)navigationController {
29
 - (void)applyOnNavigationController:(UINavigationController *)navigationController {
27
 	[self.statusBar applyOn:navigationController];
31
 	[self.statusBar applyOn:navigationController];
28
 	[self.layout applyOn:navigationController];
32
 	[self.layout applyOn:navigationController];
29
 	[self.bottomTab applyOn:navigationController];
33
 	[self.bottomTab applyOn:navigationController];
30
-	[self applyOtherOptions:self onNavigationController:navigationController];
34
+	[self applyOtherOptionsOnNavigationController:navigationController];
31
 }
35
 }
32
 
36
 
33
 - (void)applyOnTabBarController:(UITabBarController *)tabBarController {
37
 - (void)applyOnTabBarController:(UITabBarController *)tabBarController {
34
 	[self.bottomTabs applyOnTabBarController:tabBarController];
38
 	[self.bottomTabs applyOnTabBarController:tabBarController];
35
 }
39
 }
36
 
40
 
37
-- (void)applyOtherOptions:(RNNNavigationOptions *)options onNavigationController:(UINavigationController*)navigationController {
38
-	if (options.popGesture) {
39
-		navigationController.interactivePopGestureRecognizer.enabled = [options.popGesture boolValue];
41
+- (void)applyOtherOptionsOnNavigationController:(UINavigationController*)navigationController {
42
+	if (self.popGesture) {
43
+		navigationController.interactivePopGestureRecognizer.enabled = [self.popGesture boolValue];
40
 	}
44
 	}
41
 	
45
 	
42
-	if (options.rootBackgroundImage) {
46
+	if (self.rootBackgroundImage) {
43
 		UIImageView* backgroundImageView = (navigationController.view.subviews.count > 0) ? navigationController.view.subviews[0] : nil;
47
 		UIImageView* backgroundImageView = (navigationController.view.subviews.count > 0) ? navigationController.view.subviews[0] : nil;
44
 		if (![backgroundImageView isKindOfClass:[UIImageView class]]) {
48
 		if (![backgroundImageView isKindOfClass:[UIImageView class]]) {
45
 			backgroundImageView = [[UIImageView alloc] initWithFrame:navigationController.view.bounds];
49
 			backgroundImageView = [[UIImageView alloc] initWithFrame:navigationController.view.bounds];
47
 		}
51
 		}
48
 		
52
 		
49
 		backgroundImageView.layer.masksToBounds = YES;
53
 		backgroundImageView.layer.masksToBounds = YES;
50
-		backgroundImageView.image = [options.rootBackgroundImage isKindOfClass:[UIImage class]] ? (UIImage*)options.rootBackgroundImage : [RCTConvert UIImage:options.rootBackgroundImage];
54
+		backgroundImageView.image = [self.rootBackgroundImage isKindOfClass:[UIImage class]] ? (UIImage*)self.rootBackgroundImage : [RCTConvert UIImage:self.rootBackgroundImage];
51
 		[backgroundImageView setContentMode:UIViewContentModeScaleAspectFill];
55
 		[backgroundImageView setContentMode:UIViewContentModeScaleAspectFill];
52
 	}
56
 	}
53
 }
57
 }
54
 
58
 
55
-- (void)applyOtherOptions:(RNNNavigationOptions *)options on:(UIViewController*)viewController {
56
-	if (options.backgroundImage) {
59
+- (void)applyOtherOptionsOn:(UIViewController*)viewController {
60
+	if (self.backgroundImage) {
57
 		UIImageView* backgroundImageView = (viewController.view.subviews.count > 0) ? viewController.view.subviews[0] : nil;
61
 		UIImageView* backgroundImageView = (viewController.view.subviews.count > 0) ? viewController.view.subviews[0] : nil;
58
 		if (![backgroundImageView isKindOfClass:[UIImageView class]]) {
62
 		if (![backgroundImageView isKindOfClass:[UIImageView class]]) {
59
 			backgroundImageView = [[UIImageView alloc] initWithFrame:viewController.view.bounds];
63
 			backgroundImageView = [[UIImageView alloc] initWithFrame:viewController.view.bounds];
61
 		}
65
 		}
62
 		
66
 		
63
 		backgroundImageView.layer.masksToBounds = YES;
67
 		backgroundImageView.layer.masksToBounds = YES;
64
-		backgroundImageView.image = [options.backgroundImage isKindOfClass:[UIImage class]] ? (UIImage*)options.backgroundImage : [RCTConvert UIImage:options.backgroundImage];
68
+		backgroundImageView.image = [self.backgroundImage isKindOfClass:[UIImage class]] ? (UIImage*)self.backgroundImage : [RCTConvert UIImage:self.backgroundImage];
65
 		[backgroundImageView setContentMode:UIViewContentModeScaleAspectFill];
69
 		[backgroundImageView setContentMode:UIViewContentModeScaleAspectFill];
66
 	}
70
 	}
67
 
71
 
68
-	if (options.modalPresentationStyle) {
69
-		viewController.modalPresentationStyle = [RCTConvert UIModalPresentationStyle:options.modalPresentationStyle];
72
+	if (self.modalPresentationStyle) {
73
+		viewController.modalPresentationStyle = [RCTConvert UIModalPresentationStyle:self.modalPresentationStyle];
70
 		[viewController.view setBackgroundColor:[UIColor clearColor]];
74
 		[viewController.view setBackgroundColor:[UIColor clearColor]];
71
 	}
75
 	}
72
-	if (options.modalTransitionStyle) {
73
-		viewController.modalTransitionStyle = [RCTConvert UIModalTransitionStyle:options.modalTransitionStyle];
76
+	if (self.modalTransitionStyle) {
77
+		viewController.modalTransitionStyle = [RCTConvert UIModalTransitionStyle:self.modalTransitionStyle];
74
 	}
78
 	}
75
 }
79
 }
76
 
80
 

+ 0
- 8
lib/ios/RNNParentOptionsResolver.h View File

1
-#import <Foundation/Foundation.h>
2
-#import "RNNLayoutProtocol.h"
3
-
4
-@interface RNNParentOptionsResolver : NSObject
5
-
6
-- (void)resolve:(UIViewController<RNNLayoutProtocol> *)parent with:(NSArray<UIViewController<RNNLayoutProtocol> *> *)children;
7
-
8
-@end

+ 0
- 13
lib/ios/RNNParentOptionsResolver.m View File

1
-#import "RNNParentOptionsResolver.h"
2
-
3
-@implementation RNNParentOptionsResolver
4
-
5
-- (void)resolve:(UIViewController<RNNLayoutProtocol> *)parent with:(NSArray<UIViewController<RNNLayoutProtocol> *> *)children {
6
-	for (UIViewController<RNNLayoutProtocol>* child in parent.childViewControllers) {
7
-		if ([parent conformsToProtocol:@protocol(RNNLayoutProtocol)] && [child conformsToProtocol:@protocol(RNNLayoutProtocol)]) {
8
-			[parent.options mergeOptions:child.options overrideOptions:YES];
9
-		}
10
-	}
11
-}
12
-
13
-@end

+ 1
- 6
lib/ios/RNNParentProtocol.h View File

1
 #import "RNNLayoutProtocol.h"
1
 #import "RNNLayoutProtocol.h"
2
 #import "RNNLeafProtocol.h"
2
 #import "RNNLeafProtocol.h"
3
-#import "RNNParentOptionsResolver.h"
4
 
3
 
5
 @protocol RNNParentProtocol <RNNLayoutProtocol, UINavigationControllerDelegate, UIViewControllerTransitioningDelegate, UISplitViewControllerDelegate>
4
 @protocol RNNParentProtocol <RNNLayoutProtocol, UINavigationControllerDelegate, UIViewControllerTransitioningDelegate, UISplitViewControllerDelegate>
6
 
5
 
7
 @required
6
 @required
8
 
7
 
9
-@property (nonatomic, strong) RNNParentOptionsResolver* optionsResolver;
10
-
11
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter;
12
-
13
-- (UIViewController<RNNLeafProtocol> *)getLeafViewController;
8
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter;
14
 
9
 
15
 @end
10
 @end

+ 2
- 1
lib/ios/RNNRootViewController.h View File

8
 #import "RNNUIBarButtonItem.h"
8
 #import "RNNUIBarButtonItem.h"
9
 #import "RNNLayoutInfo.h"
9
 #import "RNNLayoutInfo.h"
10
 #import "RNNLeafProtocol.h"
10
 #import "RNNLeafProtocol.h"
11
+#import "RNNLayoutProtocol.h"
11
 #import "RNNViewControllerPresenter.h"
12
 #import "RNNViewControllerPresenter.h"
12
 
13
 
13
 typedef void (^PreviewCallback)(UIViewController *vc);
14
 typedef void (^PreviewCallback)(UIViewController *vc);
14
 
15
 
15
-@interface RNNRootViewController : UIViewController	<RNNLeafProtocol, UIViewControllerPreviewingDelegate, UISearchResultsUpdating, UISearchBarDelegate, UINavigationControllerDelegate, UISplitViewControllerDelegate>
16
+@interface RNNRootViewController : UIViewController	<RNNLeafProtocol, RNNLayoutProtocol, UIViewControllerPreviewingDelegate, UISearchResultsUpdating, UISearchBarDelegate, UINavigationControllerDelegate, UISplitViewControllerDelegate>
16
 
17
 
17
 @property (nonatomic, strong) RNNEventEmitter *eventEmitter;
18
 @property (nonatomic, strong) RNNEventEmitter *eventEmitter;
18
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
19
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;

+ 4
- 3
lib/ios/RNNRootViewController.m View File

85
 	[_presenter present:self.options onViewControllerDidLoad:self];
85
 	[_presenter present:self.options onViewControllerDidLoad:self];
86
 }
86
 }
87
 
87
 
88
-- (void)mergeOptions:(RNNNavigationOptions *)options {
89
-	[self.options mergeOptions:options overrideOptions:YES];
90
-	[self.presenter present:self.options onViewControllerWillAppear:self];
88
+- (void)mergeAndPresentOptions:(RNNNavigationOptions *)newOptions {
89
+	[self.options mergeOptions:newOptions overrideOptions:YES];
90
+	[_presenter present:self.options onViewControllerWillAppear:self];
91
+	
91
 	[self initReactCustomViews];
92
 	[self initReactCustomViews];
92
 }
93
 }
93
 
94
 

+ 1
- 2
lib/ios/RNNSideMenuChildVC.h View File

16
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
16
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
17
 @property (nonatomic, retain) RNNBasePresenter* presenter;
17
 @property (nonatomic, retain) RNNBasePresenter* presenter;
18
 @property (nonatomic, strong) RNNNavigationOptions* options;
18
 @property (nonatomic, strong) RNNNavigationOptions* options;
19
-@property (nonatomic, strong) RNNParentOptionsResolver* optionsResolver;
20
 
19
 
21
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter type:(RNNSideMenuChildType)type;
20
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter type:(RNNSideMenuChildType)type;
22
 
21
 
23
 @end
22
 @end

+ 3
- 10
lib/ios/RNNSideMenuChildVC.m View File

9
 
9
 
10
 @implementation RNNSideMenuChildVC
10
 @implementation RNNSideMenuChildVC
11
 
11
 
12
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter type:(RNNSideMenuChildType)type {
13
-	self = [self initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter];
12
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter type:(RNNSideMenuChildType)type {
13
+	self = [self initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter];
14
 	
14
 	
15
 	self.type = type;
15
 	self.type = type;
16
 
16
 
17
 	return self;
17
 	return self;
18
 }
18
 }
19
 
19
 
20
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter {
20
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter {
21
 	self = [super init];
21
 	self = [super init];
22
 	
22
 	
23
 	self.presenter = presenter;
23
 	self.presenter = presenter;
24
 	self.options = options;
24
 	self.options = options;
25
 	self.layoutInfo = layoutInfo;
25
 	self.layoutInfo = layoutInfo;
26
-	self.optionsResolver = optionsResolver;
27
 	
26
 	
28
 	[self bindChildViewControllers:childViewControllers];
27
 	[self bindChildViewControllers:childViewControllers];
29
 	
28
 	
45
 }
44
 }
46
 
45
 
47
 - (void)willMoveToParentViewController:(UIViewController *)parent {
46
 - (void)willMoveToParentViewController:(UIViewController *)parent {
48
-	[_optionsResolver resolve:self with:self.childViewControllers];
49
 	[_presenter present:self.options onViewControllerDidLoad:self];
47
 	[_presenter present:self.options onViewControllerDidLoad:self];
50
 }
48
 }
51
 
49
 
52
-- (void)mergeOptions:(RNNNavigationOptions *)options {
53
-	[self.options mergeOptions:options overrideOptions:YES];
54
-	[self.presenter present:self.options onViewControllerWillAppear:self];
55
-}
56
-
57
 - (UIStatusBarStyle)preferredStatusBarStyle {
50
 - (UIStatusBarStyle)preferredStatusBarStyle {
58
 	return self.child.preferredStatusBarStyle;
51
 	return self.child.preferredStatusBarStyle;
59
 }
52
 }

+ 0
- 1
lib/ios/RNNSideMenuController.h View File

21
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
21
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
22
 @property (nonatomic, retain) RNNBasePresenter* presenter;
22
 @property (nonatomic, retain) RNNBasePresenter* presenter;
23
 @property (nonatomic, strong) RNNNavigationOptions* options;
23
 @property (nonatomic, strong) RNNNavigationOptions* options;
24
-@property (nonatomic, strong) RNNParentOptionsResolver* optionsResolver;
25
 
24
 
26
 -(void)showSideMenu:(MMDrawerSide)side animated:(BOOL)animated;
25
 -(void)showSideMenu:(MMDrawerSide)side animated:(BOOL)animated;
27
 -(void)hideSideMenu:(MMDrawerSide)side animated:(BOOL)animated;
26
 -(void)hideSideMenu:(MMDrawerSide)side animated:(BOOL)animated;

+ 1
- 8
lib/ios/RNNSideMenuController.m View File

21
 
21
 
22
 @implementation RNNSideMenuController
22
 @implementation RNNSideMenuController
23
 
23
 
24
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter {
24
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter {
25
 	self = [super init];
25
 	self = [super init];
26
 	
26
 	
27
 	self.presenter = presenter;
27
 	self.presenter = presenter;
28
 	self.options = options;
28
 	self.options = options;
29
 	self.layoutInfo = layoutInfo;
29
 	self.layoutInfo = layoutInfo;
30
-	self.optionsResolver = optionsResolver;
31
 	
30
 	
32
 	[self bindChildViewControllers:childViewControllers];
31
 	[self bindChildViewControllers:childViewControllers];
33
 	
32
 	
106
 }
105
 }
107
 
106
 
108
 - (void)willMoveToParentViewController:(UIViewController *)parent {
107
 - (void)willMoveToParentViewController:(UIViewController *)parent {
109
-	[_optionsResolver resolve:self with:self.childViewControllers];
110
 	[_presenter present:self.options onViewControllerDidLoad:self];
108
 	[_presenter present:self.options onViewControllerDidLoad:self];
111
 }
109
 }
112
 
110
 
113
-- (void)mergeOptions:(RNNNavigationOptions *)options {
114
-	[self.options mergeOptions:options overrideOptions:YES];
115
-	[self.presenter present:self.options onViewControllerWillAppear:self];
116
-}
117
-
118
 @end
111
 @end

+ 0
- 1
lib/ios/RNNSplitViewController.h View File

15
 @property (nonatomic, strong) RNNNavigationOptions* options;
15
 @property (nonatomic, strong) RNNNavigationOptions* options;
16
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
16
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
17
 @property (nonatomic, retain) RNNBasePresenter* presenter;
17
 @property (nonatomic, retain) RNNBasePresenter* presenter;
18
-@property (nonatomic, strong) RNNParentOptionsResolver* optionsResolver;
19
 
18
 
20
 @end
19
 @end

+ 1
- 7
lib/ios/RNNSplitViewController.m View File

2
 
2
 
3
 @implementation RNNSplitViewController
3
 @implementation RNNSplitViewController
4
 
4
 
5
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter {
5
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter {
6
 	self = [super init];
6
 	self = [super init];
7
 	
7
 	
8
 	self.presenter = presenter;
8
 	self.presenter = presenter;
9
 	self.options = options;
9
 	self.options = options;
10
 	self.layoutInfo = layoutInfo;
10
 	self.layoutInfo = layoutInfo;
11
-	self.optionsResolver = optionsResolver;
12
 	
11
 	
13
 	self.navigationController.delegate = self;
12
 	self.navigationController.delegate = self;
14
 	
13
 	
33
 }
32
 }
34
 
33
 
35
 - (void)willMoveToParentViewController:(UIViewController *)parent {
34
 - (void)willMoveToParentViewController:(UIViewController *)parent {
36
-	[_optionsResolver resolve:self with:self.viewControllers];
37
 	[_presenter present:self.options onViewControllerDidLoad:self];
35
 	[_presenter present:self.options onViewControllerDidLoad:self];
38
 }
36
 }
39
 
37
 
40
-- (void)mergeOptions:(RNNNavigationOptions *)options {
41
-	[self.options mergeOptions:options overrideOptions:YES];
42
-	[self.presenter present:self.options onViewControllerWillAppear:self];
43
-}
44
 
38
 
45
 @end
39
 @end

+ 1
- 2
lib/ios/RNNTabBarController.h View File

5
 
5
 
6
 @interface RNNTabBarController : UITabBarController <RNNParentProtocol, UITabBarControllerDelegate>
6
 @interface RNNTabBarController : UITabBarController <RNNParentProtocol, UITabBarControllerDelegate>
7
 
7
 
8
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter eventEmitter:(RNNEventEmitter *)eventEmitter;
8
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter eventEmitter:(RNNEventEmitter *)eventEmitter;
9
 
9
 
10
 - (void)setSelectedIndexByComponentID:(NSString *)componentID;
10
 - (void)setSelectedIndexByComponentID:(NSString *)componentID;
11
 
11
 
12
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
12
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
13
 @property (nonatomic, retain) RNNBasePresenter* presenter;
13
 @property (nonatomic, retain) RNNBasePresenter* presenter;
14
 @property (nonatomic, strong) RNNNavigationOptions* options;
14
 @property (nonatomic, strong) RNNNavigationOptions* options;
15
-@property (nonatomic, strong) RNNParentOptionsResolver* optionsResolver;
16
 
15
 
17
 @end
16
 @end

+ 1
- 10
lib/ios/RNNTabBarController.m View File

11
 - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo
11
 - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo
12
 			  childViewControllers:(NSArray *)childViewControllers
12
 			  childViewControllers:(NSArray *)childViewControllers
13
 						   options:(RNNNavigationOptions *)options
13
 						   options:(RNNNavigationOptions *)options
14
-				   optionsResolver:(RNNParentOptionsResolver *)optionsResolver
15
 						 presenter:(RNNBasePresenter *)presenter
14
 						 presenter:(RNNBasePresenter *)presenter
16
 					  eventEmitter:(RNNEventEmitter *)eventEmitter {
15
 					  eventEmitter:(RNNEventEmitter *)eventEmitter {
17
-	self = [self initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter];
16
+	self = [self initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter];
18
 	
17
 	
19
 	_eventEmitter = eventEmitter;
18
 	_eventEmitter = eventEmitter;
20
 	
19
 	
24
 - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo
23
 - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo
25
 			  childViewControllers:(NSArray *)childViewControllers
24
 			  childViewControllers:(NSArray *)childViewControllers
26
 						   options:(RNNNavigationOptions *)options
25
 						   options:(RNNNavigationOptions *)options
27
-				   optionsResolver:(RNNParentOptionsResolver *)optionsResolver
28
 						 presenter:(RNNBasePresenter *)presenter {
26
 						 presenter:(RNNBasePresenter *)presenter {
29
 	self = [super init];
27
 	self = [super init];
30
 	
28
 	
31
 	self.presenter = presenter;
29
 	self.presenter = presenter;
32
 	self.options = options;
30
 	self.options = options;
33
 	self.layoutInfo = layoutInfo;
31
 	self.layoutInfo = layoutInfo;
34
-	self.optionsResolver = optionsResolver;
35
 	
32
 	
36
 	[self setViewControllers:childViewControllers];
33
 	[self setViewControllers:childViewControllers];
37
 	
34
 	
73
 }
70
 }
74
 
71
 
75
 - (void)willMoveToParentViewController:(UIViewController *)parent {
72
 - (void)willMoveToParentViewController:(UIViewController *)parent {
76
-	[_optionsResolver resolve:self with:self.viewControllers];
77
 	[_presenter present:self.options onViewControllerDidLoad:self];
73
 	[_presenter present:self.options onViewControllerDidLoad:self];
78
 }
74
 }
79
 
75
 
80
-- (void)mergeOptions:(RNNNavigationOptions *)options {
81
-	[self.options mergeOptions:options overrideOptions:YES];
82
-	[self.presenter present:self.options onViewControllerWillAppear:self];
83
-}
84
-
85
 #pragma mark UITabBarControllerDelegate
76
 #pragma mark UITabBarControllerDelegate
86
 
77
 
87
 - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
78
 - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {

+ 0
- 1
lib/ios/RNNTopTabsViewController.h View File

10
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
10
 @property (nonatomic, retain) RNNLayoutInfo* layoutInfo;
11
 @property (nonatomic, retain) RNNBasePresenter* presenter;
11
 @property (nonatomic, retain) RNNBasePresenter* presenter;
12
 @property (nonatomic, strong) RNNNavigationOptions* options;
12
 @property (nonatomic, strong) RNNNavigationOptions* options;
13
-@property (nonatomic, strong) RNNParentOptionsResolver* optionsResolver;
14
 
13
 
15
 - (void)setViewControllers:(NSArray*)viewControllers;
14
 - (void)setViewControllers:(NSArray*)viewControllers;
16
 - (void)viewController:(UIViewController*)vc changedTitle:(NSString*)title;
15
 - (void)viewController:(UIViewController*)vc changedTitle:(NSString*)title;

+ 1
- 7
lib/ios/RNNTopTabsViewController.m View File

13
 
13
 
14
 @implementation RNNTopTabsViewController
14
 @implementation RNNTopTabsViewController
15
 
15
 
16
-- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter {
16
+- (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter {
17
 	self = [self init];
17
 	self = [self init];
18
 	
18
 	
19
 	self.presenter = presenter;
19
 	self.presenter = presenter;
20
 	self.options = options;
20
 	self.options = options;
21
 	self.layoutInfo = layoutInfo;
21
 	self.layoutInfo = layoutInfo;
22
-	self.optionsResolver = optionsResolver;
23
 	
22
 	
24
 	[self setViewControllers:childViewControllers];
23
 	[self setViewControllers:childViewControllers];
25
 	
24
 	
86
 }
85
 }
87
 
86
 
88
 - (void)willMoveToParentViewController:(UIViewController *)parent {
87
 - (void)willMoveToParentViewController:(UIViewController *)parent {
89
-	[_optionsResolver resolve:self with:_viewControllers];
90
 	[_presenter present:self.options onViewControllerDidLoad:self];
88
 	[_presenter present:self.options onViewControllerDidLoad:self];
91
 }
89
 }
92
 
90
 
93
-- (void)mergeOptions:(RNNNavigationOptions *)options {
94
-	[self.options mergeOptions:options overrideOptions:YES];
95
-	[self.presenter present:self.options onViewControllerWillAppear:self];
96
-}
97
 
91
 
98
 #pragma mark RNNParentProtocol
92
 #pragma mark RNNParentProtocol
99
 
93
 

+ 0
- 8
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

115
 		50644A2120E11A720026709C /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 50644A1F20E11A720026709C /* Constants.m */; };
115
 		50644A2120E11A720026709C /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 50644A1F20E11A720026709C /* Constants.m */; };
116
 		506A2B1420973DFD00F43A95 /* RNNErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 506A2B1220973DFD00F43A95 /* RNNErrorHandler.h */; };
116
 		506A2B1420973DFD00F43A95 /* RNNErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 506A2B1220973DFD00F43A95 /* RNNErrorHandler.h */; };
117
 		506A2B1520973DFD00F43A95 /* RNNErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 506A2B1320973DFD00F43A95 /* RNNErrorHandler.m */; };
117
 		506A2B1520973DFD00F43A95 /* RNNErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 506A2B1320973DFD00F43A95 /* RNNErrorHandler.m */; };
118
-		506F62E22163912E00AD0D0A /* RNNParentOptionsResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 506F62E02163912E00AD0D0A /* RNNParentOptionsResolver.h */; };
119
-		506F62E32163912E00AD0D0A /* RNNParentOptionsResolver.m in Sources */ = {isa = PBXBuildFile; fileRef = 506F62E12163912E00AD0D0A /* RNNParentOptionsResolver.m */; };
120
 		50706E6D20CE7CA5003345C3 /* UIImage+tint.h in Headers */ = {isa = PBXBuildFile; fileRef = 50706E6B20CE7CA5003345C3 /* UIImage+tint.h */; };
118
 		50706E6D20CE7CA5003345C3 /* UIImage+tint.h in Headers */ = {isa = PBXBuildFile; fileRef = 50706E6B20CE7CA5003345C3 /* UIImage+tint.h */; };
121
 		50706E6E20CE7CA5003345C3 /* UIImage+tint.m in Sources */ = {isa = PBXBuildFile; fileRef = 50706E6C20CE7CA5003345C3 /* UIImage+tint.m */; };
119
 		50706E6E20CE7CA5003345C3 /* UIImage+tint.m in Sources */ = {isa = PBXBuildFile; fileRef = 50706E6C20CE7CA5003345C3 /* UIImage+tint.m */; };
122
 		50762D08205E96C200E3D18A /* RNNModalAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 50762D06205E96C200E3D18A /* RNNModalAnimation.h */; };
120
 		50762D08205E96C200E3D18A /* RNNModalAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 50762D06205E96C200E3D18A /* RNNModalAnimation.h */; };
360
 		50644A1F20E11A720026709C /* Constants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = "<group>"; };
358
 		50644A1F20E11A720026709C /* Constants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = "<group>"; };
361
 		506A2B1220973DFD00F43A95 /* RNNErrorHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNErrorHandler.h; sourceTree = "<group>"; };
359
 		506A2B1220973DFD00F43A95 /* RNNErrorHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNErrorHandler.h; sourceTree = "<group>"; };
362
 		506A2B1320973DFD00F43A95 /* RNNErrorHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNErrorHandler.m; sourceTree = "<group>"; };
360
 		506A2B1320973DFD00F43A95 /* RNNErrorHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNErrorHandler.m; sourceTree = "<group>"; };
363
-		506F62E02163912E00AD0D0A /* RNNParentOptionsResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNParentOptionsResolver.h; sourceTree = "<group>"; };
364
-		506F62E12163912E00AD0D0A /* RNNParentOptionsResolver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNParentOptionsResolver.m; sourceTree = "<group>"; };
365
 		50706E6B20CE7CA5003345C3 /* UIImage+tint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+tint.h"; sourceTree = "<group>"; };
361
 		50706E6B20CE7CA5003345C3 /* UIImage+tint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+tint.h"; sourceTree = "<group>"; };
366
 		50706E6C20CE7CA5003345C3 /* UIImage+tint.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+tint.m"; sourceTree = "<group>"; };
362
 		50706E6C20CE7CA5003345C3 /* UIImage+tint.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+tint.m"; sourceTree = "<group>"; };
367
 		50762D06205E96C200E3D18A /* RNNModalAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNModalAnimation.h; sourceTree = "<group>"; };
363
 		50762D06205E96C200E3D18A /* RNNModalAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNModalAnimation.h; sourceTree = "<group>"; };
706
 				50570BE82063E09B006A1B5C /* RNNTitleViewHelper.h */,
702
 				50570BE82063E09B006A1B5C /* RNNTitleViewHelper.h */,
707
 				501CD31D214A5B6900A6E225 /* RNNLayoutInfo.h */,
703
 				501CD31D214A5B6900A6E225 /* RNNLayoutInfo.h */,
708
 				501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */,
704
 				501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */,
709
-				506F62E02163912E00AD0D0A /* RNNParentOptionsResolver.h */,
710
-				506F62E12163912E00AD0D0A /* RNNParentOptionsResolver.m */,
711
 				50220F46212ABDFD004C2B0A /* RNNReactRootView.h */,
705
 				50220F46212ABDFD004C2B0A /* RNNReactRootView.h */,
712
 				50220F47212ABDFD004C2B0A /* RNNReactRootView.m */,
706
 				50220F47212ABDFD004C2B0A /* RNNReactRootView.m */,
713
 				501E0215213E7EA3003365C5 /* RNNReactView.h */,
707
 				501E0215213E7EA3003365C5 /* RNNReactView.h */,
918
 				50415CBA20553B8E00BB682E /* RNNScreenTransition.h in Headers */,
912
 				50415CBA20553B8E00BB682E /* RNNScreenTransition.h in Headers */,
919
 				263905C21E4C6F440023D7D3 /* SidebarAnimation.h in Headers */,
913
 				263905C21E4C6F440023D7D3 /* SidebarAnimation.h in Headers */,
920
 				E8E518361F83B94A000467AC /* RNNViewLocation.h in Headers */,
914
 				E8E518361F83B94A000467AC /* RNNViewLocation.h in Headers */,
921
-				506F62E22163912E00AD0D0A /* RNNParentOptionsResolver.h in Headers */,
922
 				505EDD34214E7B7B0071C7DE /* RNNLeafProtocol.h in Headers */,
915
 				505EDD34214E7B7B0071C7DE /* RNNLeafProtocol.h in Headers */,
923
 				263905B51E4C6F440023D7D3 /* MMExampleDrawerVisualStateManager.h in Headers */,
916
 				263905B51E4C6F440023D7D3 /* MMExampleDrawerVisualStateManager.h in Headers */,
924
 				50451D052042DAEB00695F00 /* RNNPushAnimation.h in Headers */,
917
 				50451D052042DAEB00695F00 /* RNNPushAnimation.h in Headers */,
1188
 				50F5DFC61F407AA0001A00BC /* RNNNavigationController.m in Sources */,
1181
 				50F5DFC61F407AA0001A00BC /* RNNNavigationController.m in Sources */,
1189
 				21B85E5D1F44480200B314B5 /* RNNNavigationButtons.m in Sources */,
1182
 				21B85E5D1F44480200B314B5 /* RNNNavigationButtons.m in Sources */,
1190
 				E8E518371F83B94A000467AC /* RNNViewLocation.m in Sources */,
1183
 				E8E518371F83B94A000467AC /* RNNViewLocation.m in Sources */,
1191
-				506F62E32163912E00AD0D0A /* RNNParentOptionsResolver.m in Sources */,
1192
 				E3458D3E20BD9CE40023149B /* RNNPreviewOptions.m in Sources */,
1184
 				E3458D3E20BD9CE40023149B /* RNNPreviewOptions.m in Sources */,
1193
 				263905C91E4C6F440023D7D3 /* SidebarFlipboardAnimation.m in Sources */,
1185
 				263905C91E4C6F440023D7D3 /* SidebarFlipboardAnimation.m in Sources */,
1194
 			);
1186
 			);

+ 3
- 3
lib/ios/ReactNativeNavigationTests/RNNNavigationControllerTest.m View File

43
 	NSNumber* popGestureEnabled = @(0);
43
 	NSNumber* popGestureEnabled = @(0);
44
 	self.uut.options.popGesture = popGestureEnabled;
44
 	self.uut.options.popGesture = popGestureEnabled;
45
 	
45
 	
46
-	[self.uut viewDidLoad];
46
+	[self.uut willMoveToParentViewController:nil];
47
 
47
 
48
 	XCTAssertFalse(self.uut.interactivePopGestureRecognizer.enabled);
48
 	XCTAssertFalse(self.uut.interactivePopGestureRecognizer.enabled);
49
 }
49
 }
60
 - (void)testRootBackgroundImage {
60
 - (void)testRootBackgroundImage {
61
 	UIImage* rootBackgroundImage = [[UIImage alloc] init];
61
 	UIImage* rootBackgroundImage = [[UIImage alloc] init];
62
 	self.uut.options.rootBackgroundImage = rootBackgroundImage;
62
 	self.uut.options.rootBackgroundImage = rootBackgroundImage;
63
-	[self.uut viewDidLoad];
63
+	[self.uut willMoveToParentViewController:nil];
64
 	XCTAssertTrue([[(UIImageView*)self.uut.view.subviews[0] image] isEqual:rootBackgroundImage]);
64
 	XCTAssertTrue([[(UIImageView*)self.uut.view.subviews[0] image] isEqual:rootBackgroundImage]);
65
 }
65
 }
66
 
66
 
67
 - (void)testTopBarBackgroundClipToBounds_true {
67
 - (void)testTopBarBackgroundClipToBounds_true {
68
 	self.uut.options.topBar.background.clipToBounds = @(1);
68
 	self.uut.options.topBar.background.clipToBounds = @(1);
69
-	[self.uut viewDidLoad];
69
+	[self.uut willMoveToParentViewController:nil];
70
 
70
 
71
 	XCTAssertTrue(self.uut.navigationBar.clipsToBounds);
71
 	XCTAssertTrue(self.uut.navigationBar.clipsToBounds);
72
 }
72
 }