Browse Source

Remove get current leaf, better options resolving (#4700)

* Remove currentLeaf

* Fix resolve options

* Remove irrelevant test

* Remove RNNRootViewController clear background color

* Fix title with subtitle options
Yogev Ben David 5 years ago
parent
commit
7e15d59bbc
No account linked to committer's email address

+ 4
- 4
lib/ios/RNNBasePresenter.m View File

1
 #import "RNNBasePresenter.h"
1
 #import "RNNBasePresenter.h"
2
 #import "UIViewController+RNNOptions.h"
2
 #import "UIViewController+RNNOptions.h"
3
 #import "RNNTabBarItemCreator.h"
3
 #import "RNNTabBarItemCreator.h"
4
-#import "RNNReactComponentManager.h"
4
+#import "RNNReactComponentRegistry.h"
5
 
5
 
6
 @interface RNNBasePresenter ()
6
 @interface RNNBasePresenter ()
7
-@property (nonatomic, strong) RNNReactComponentManager* componentManager;
7
+@property (nonatomic, strong) RNNReactComponentRegistry* componentRegistry;
8
 @end
8
 @end
9
 
9
 
10
 
10
 
11
 @implementation RNNBasePresenter
11
 @implementation RNNBasePresenter
12
 
12
 
13
-- (instancetype)initWithComponentManager:(RNNReactComponentManager *)componentManager {
13
+- (instancetype)initWithcomponentRegistry:(RNNReactComponentRegistry *)componentRegistry {
14
 	self = [super init];
14
 	self = [super init];
15
-	self.componentManager = componentManager;
15
+	self.componentRegistry = componentRegistry;
16
 	return self;
16
 	return self;
17
 }
17
 }
18
 
18
 

+ 5
- 5
lib/ios/RNNBridgeManager.m View File

8
 #import "RNNBridgeModule.h"
8
 #import "RNNBridgeModule.h"
9
 #import "RNNRootViewCreator.h"
9
 #import "RNNRootViewCreator.h"
10
 #import "RNNReactRootViewCreator.h"
10
 #import "RNNReactRootViewCreator.h"
11
-#import "RNNReactComponentManager.h"
11
+#import "RNNReactComponentRegistry.h"
12
 
12
 
13
 @interface RNNBridgeManager() <RCTBridgeDelegate>
13
 @interface RNNBridgeManager() <RCTBridgeDelegate>
14
 
14
 
15
 @property (nonatomic, strong, readwrite) RCTBridge *bridge;
15
 @property (nonatomic, strong, readwrite) RCTBridge *bridge;
16
 @property (nonatomic, strong, readwrite) RNNStore *store;
16
 @property (nonatomic, strong, readwrite) RNNStore *store;
17
-@property (nonatomic, strong, readwrite) RNNReactComponentManager *componentManager;
17
+@property (nonatomic, strong, readwrite) RNNReactComponentRegistry *componentRegistry;
18
 
18
 
19
 @end
19
 @end
20
 
20
 
79
 	RNNEventEmitter *eventEmitter = [[RNNEventEmitter alloc] init];
79
 	RNNEventEmitter *eventEmitter = [[RNNEventEmitter alloc] init];
80
 
80
 
81
 	id<RNNRootViewCreator> rootViewCreator = [[RNNReactRootViewCreator alloc] initWithBridge:bridge];
81
 	id<RNNRootViewCreator> rootViewCreator = [[RNNReactRootViewCreator alloc] initWithBridge:bridge];
82
-	_componentManager = [[RNNReactComponentManager alloc] initWithCreator:rootViewCreator];
83
-	RNNControllerFactory *controllerFactory = [[RNNControllerFactory alloc] initWithRootViewCreator:rootViewCreator eventEmitter:eventEmitter store:_store componentManager:_componentManager andBridge:bridge];
82
+	_componentRegistry = [[RNNReactComponentRegistry alloc] initWithCreator:rootViewCreator];
83
+	RNNControllerFactory *controllerFactory = [[RNNControllerFactory alloc] initWithRootViewCreator:rootViewCreator eventEmitter:eventEmitter store:_store componentRegistry:_componentRegistry andBridge:bridge];
84
 	
84
 	
85
 	_commandsHandler = [[RNNCommandsHandler alloc] initWithStore:_store controllerFactory:controllerFactory eventEmitter:eventEmitter stackManager:[RNNNavigationStackManager new] modalManager:[RNNModalManager new] overlayManager:[RNNOverlayManager new] mainWindow:_mainWindow];
85
 	_commandsHandler = [[RNNCommandsHandler alloc] initWithStore:_store controllerFactory:controllerFactory eventEmitter:eventEmitter stackManager:[RNNNavigationStackManager new] modalManager:[RNNModalManager new] overlayManager:[RNNOverlayManager new] mainWindow:_mainWindow];
86
 	RNNBridgeModule *bridgeModule = [[RNNBridgeModule alloc] initWithCommandsHandler:_commandsHandler];
86
 	RNNBridgeModule *bridgeModule = [[RNNBridgeModule alloc] initWithCommandsHandler:_commandsHandler];
92
 
92
 
93
 - (void)onJavaScriptWillLoad {
93
 - (void)onJavaScriptWillLoad {
94
 	[_store clean];
94
 	[_store clean];
95
-	[_componentManager clean];
95
+	[_componentRegistry clean];
96
 }
96
 }
97
 
97
 
98
 - (void)onJavaScriptLoaded {
98
 - (void)onJavaScriptLoaded {

+ 3
- 3
lib/ios/RNNCommandsHandler.m View File

141
 			});
141
 			});
142
 		}
142
 		}
143
 	} else {
143
 	} else {
144
-		id animationDelegate = (newVc.resolveOptions.animations.push.hasCustomAnimation || newVc.getCurrentLeaf.isCustomTransitioned) ? newVc : nil;
144
+		id animationDelegate = (newVc.resolveOptions.animations.push.hasCustomAnimation || newVc.resolveOptions.customTransition.animations) ? newVc : nil;
145
 		[newVc renderTreeAndWait:([newVc.resolveOptions.animations.push.waitForRender getWithDefaultValue:NO] || animationDelegate) perform:^{
145
 		[newVc renderTreeAndWait:([newVc.resolveOptions.animations.push.waitForRender getWithDefaultValue:NO] || animationDelegate) perform:^{
146
 			[_stackManager push:newVc onTop:fromVC animated:[newVc.resolveOptions.animations.push.enable getWithDefaultValue:YES] animationDelegate:animationDelegate completion:^{
146
 			[_stackManager push:newVc onTop:fromVC animated:[newVc.resolveOptions.animations.push.enable getWithDefaultValue:YES] animationDelegate:animationDelegate completion:^{
147
 				[_eventEmitter sendOnNavigationCommandCompletion:push params:@{@"componentId": componentId}];
147
 				[_eventEmitter sendOnNavigationCommandCompletion:push params:@{@"componentId": componentId}];
234
 	
234
 	
235
 	UIViewController<RNNParentProtocol> *newVc = [_controllerFactory createLayout:layout];
235
 	UIViewController<RNNParentProtocol> *newVc = [_controllerFactory createLayout:layout];
236
 	
236
 	
237
-	[newVc renderTreeAndWait:[newVc.getCurrentLeaf.resolveOptions.animations.showModal.waitForRender getWithDefaultValue:NO] perform:^{
237
+	[newVc renderTreeAndWait:[newVc.resolveOptions.animations.showModal.waitForRender getWithDefaultValue:NO] perform:^{
238
 		[_modalManager showModal:newVc animated:[newVc.getCurrentChild.resolveOptions.animations.showModal.enable getWithDefaultValue:YES] hasCustomAnimation:newVc.getCurrentChild.resolveOptions.animations.showModal.hasCustomAnimation completion:^(NSString *componentId) {
238
 		[_modalManager showModal:newVc animated:[newVc.getCurrentChild.resolveOptions.animations.showModal.enable getWithDefaultValue:YES] hasCustomAnimation:newVc.getCurrentChild.resolveOptions.animations.showModal.hasCustomAnimation completion:^(NSString *componentId) {
239
 			[_eventEmitter sendOnNavigationCommandCompletion:showModal params:@{@"layout": layout}];
239
 			[_eventEmitter sendOnNavigationCommandCompletion:showModal params:@{@"layout": layout}];
240
 			completion(componentId);
240
 			completion(componentId);
285
 	[self assertReady];
285
 	[self assertReady];
286
 	
286
 	
287
 	UIViewController<RNNParentProtocol>* overlayVC = [_controllerFactory createLayout:layout];
287
 	UIViewController<RNNParentProtocol>* overlayVC = [_controllerFactory createLayout:layout];
288
-	[overlayVC renderTreeAndWait:[overlayVC.options.animations.showOverlay.waitForRender getWithDefaultValue:NO] perform:^{
288
+	[overlayVC renderTreeAndWait:NO perform:^{
289
 		UIWindow* overlayWindow = [[RNNOverlayWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
289
 		UIWindow* overlayWindow = [[RNNOverlayWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
290
 		overlayWindow.rootViewController = overlayVC;
290
 		overlayWindow.rootViewController = overlayVC;
291
 		[_overlayManager showOverlayWindow:overlayWindow];
291
 		[_overlayManager showOverlayWindow:overlayWindow];

+ 2
- 2
lib/ios/RNNControllerFactory.h View File

5
 #import "RNNStore.h"
5
 #import "RNNStore.h"
6
 #import "RNNEventEmitter.h"
6
 #import "RNNEventEmitter.h"
7
 #import "RNNParentProtocol.h"
7
 #import "RNNParentProtocol.h"
8
-#import "RNNReactComponentManager.h"
8
+#import "RNNReactComponentRegistry.h"
9
 
9
 
10
 @interface RNNControllerFactory : NSObject
10
 @interface RNNControllerFactory : NSObject
11
 
11
 
12
 -(instancetype)initWithRootViewCreator:(id <RNNRootViewCreator>)creator
12
 -(instancetype)initWithRootViewCreator:(id <RNNRootViewCreator>)creator
13
 						  eventEmitter:(RNNEventEmitter*)eventEmitter
13
 						  eventEmitter:(RNNEventEmitter*)eventEmitter
14
 								 store:(RNNStore *)store
14
 								 store:(RNNStore *)store
15
-					  componentManager:(RNNReactComponentManager *)componentManager
15
+					  componentRegistry:(RNNReactComponentRegistry *)componentRegistry
16
 							 andBridge:(RCTBridge*)bridge;
16
 							 andBridge:(RCTBridge*)bridge;
17
 
17
 
18
 - (UIViewController<RNNParentProtocol> *)createLayout:(NSDictionary*)layout;
18
 - (UIViewController<RNNParentProtocol> *)createLayout:(NSDictionary*)layout;

+ 5
- 5
lib/ios/RNNControllerFactory.m View File

20
 	id<RNNRootViewCreator> _creator;
20
 	id<RNNRootViewCreator> _creator;
21
 	RNNStore *_store;
21
 	RNNStore *_store;
22
 	RCTBridge *_bridge;
22
 	RCTBridge *_bridge;
23
-	RNNReactComponentManager* _componentManager;
23
+	RNNReactComponentRegistry* _componentRegistry;
24
 }
24
 }
25
 
25
 
26
 # pragma mark public
26
 # pragma mark public
29
 - (instancetype)initWithRootViewCreator:(id <RNNRootViewCreator>)creator
29
 - (instancetype)initWithRootViewCreator:(id <RNNRootViewCreator>)creator
30
 						   eventEmitter:(RNNEventEmitter*)eventEmitter
30
 						   eventEmitter:(RNNEventEmitter*)eventEmitter
31
 								  store:(RNNStore *)store
31
 								  store:(RNNStore *)store
32
-					   componentManager:(RNNReactComponentManager *)componentManager
32
+					   componentRegistry:(RNNReactComponentRegistry *)componentRegistry
33
 							  andBridge:(RCTBridge *)bridge {
33
 							  andBridge:(RCTBridge *)bridge {
34
 	
34
 	
35
 	self = [super init];
35
 	self = [super init];
38
 	_eventEmitter = eventEmitter;
38
 	_eventEmitter = eventEmitter;
39
 	_bridge = bridge;
39
 	_bridge = bridge;
40
 	_store = store;
40
 	_store = store;
41
-	_componentManager = componentManager;
41
+	_componentRegistry = componentRegistry;
42
 	
42
 	
43
 	return self;
43
 	return self;
44
 }
44
 }
115
 - (UIViewController<RNNParentProtocol> *)createComponent:(RNNLayoutNode*)node {
115
 - (UIViewController<RNNParentProtocol> *)createComponent:(RNNLayoutNode*)node {
116
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
116
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
117
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]];;
117
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]];;
118
-	RNNViewControllerPresenter* presenter = [[RNNViewControllerPresenter alloc] initWithComponentManager:_componentManager];
118
+	RNNViewControllerPresenter* presenter = [[RNNViewControllerPresenter alloc] initWithcomponentRegistry:_componentRegistry];
119
 	
119
 	
120
 	RNNRootViewController* component = [[RNNRootViewController alloc] initWithLayoutInfo:layoutInfo rootViewCreator:_creator eventEmitter:_eventEmitter presenter:presenter options:options defaultOptions:_defaultOptions];
120
 	RNNRootViewController* component = [[RNNRootViewController alloc] initWithLayoutInfo:layoutInfo rootViewCreator:_creator eventEmitter:_eventEmitter presenter:presenter options:options defaultOptions:_defaultOptions];
121
 	
121
 	
137
 
137
 
138
 
138
 
139
 - (UIViewController<RNNParentProtocol> *)createStack:(RNNLayoutNode*)node {
139
 - (UIViewController<RNNParentProtocol> *)createStack:(RNNLayoutNode*)node {
140
-	RNNNavigationControllerPresenter* presenter = [[RNNNavigationControllerPresenter alloc] initWithComponentManager:_componentManager];
140
+	RNNNavigationControllerPresenter* presenter = [[RNNNavigationControllerPresenter alloc] initWithcomponentRegistry:_componentRegistry];
141
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
141
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
142
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]];;
142
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]];;
143
 	
143
 	

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

17
 
17
 
18
 - (UIViewController<RNNLayoutProtocol> *)getCurrentChild;
18
 - (UIViewController<RNNLayoutProtocol> *)getCurrentChild;
19
 
19
 
20
-- (UIViewController<RNNLeafProtocol, RNNLayoutProtocol> *)getCurrentLeaf;
21
-
22
 - (void)mergeOptions:(RNNNavigationOptions *)options;
20
 - (void)mergeOptions:(RNNNavigationOptions *)options;
23
 
21
 
24
 - (RNNNavigationOptions *)resolveOptions;
22
 - (RNNNavigationOptions *)resolveOptions;

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

60
 
60
 
61
 -(void)removePendingNextModalIfOnTop:(RNNTransitionCompletionBlock)completion {
61
 -(void)removePendingNextModalIfOnTop:(RNNTransitionCompletionBlock)completion {
62
 	UIViewController<RNNParentProtocol> *modalToDismiss = [_pendingModalIdsToDismiss lastObject];
62
 	UIViewController<RNNParentProtocol> *modalToDismiss = [_pendingModalIdsToDismiss lastObject];
63
-	RNNNavigationOptions* options = modalToDismiss.getCurrentChild.resolveOptions;
63
+	RNNNavigationOptions* options = modalToDismiss.resolveOptions;
64
 
64
 
65
 	if(!modalToDismiss) {
65
 	if(!modalToDismiss) {
66
 		return;
66
 		return;

+ 2
- 2
lib/ios/RNNNavigationButtons.h View File

2
 #import <UIKit/UIKit.h>
2
 #import <UIKit/UIKit.h>
3
 #import "RNNButtonOptions.h"
3
 #import "RNNButtonOptions.h"
4
 #import "RNNRootViewCreator.h"
4
 #import "RNNRootViewCreator.h"
5
-#import "RNNReactComponentManager.h"
5
+#import "RNNReactComponentRegistry.h"
6
 
6
 
7
 @interface RNNNavigationButtons : NSObject
7
 @interface RNNNavigationButtons : NSObject
8
 
8
 
9
--(instancetype)initWithViewController:(UIViewController*)viewController componentManager:(RNNReactComponentManager *)componentManager;
9
+-(instancetype)initWithViewController:(UIViewController*)viewController componentRegistry:(RNNReactComponentRegistry *)componentRegistry;
10
 
10
 
11
 -(void)applyLeftButtons:(NSArray*)leftButtons rightButtons:(NSArray*)rightButtons defaultLeftButtonStyle:(RNNButtonOptions *)defaultLeftButtonStyle defaultRightButtonStyle:(RNNButtonOptions *)defaultRightButtonStyle;
11
 -(void)applyLeftButtons:(NSArray*)leftButtons rightButtons:(NSArray*)rightButtons defaultLeftButtonStyle:(RNNButtonOptions *)defaultLeftButtonStyle defaultRightButtonStyle:(RNNButtonOptions *)defaultRightButtonStyle;
12
 
12
 

+ 4
- 4
lib/ios/RNNNavigationButtons.m View File

11
 @property (weak, nonatomic) UIViewController<RNNLayoutProtocol>* viewController;
11
 @property (weak, nonatomic) UIViewController<RNNLayoutProtocol>* viewController;
12
 @property (strong, nonatomic) RNNButtonOptions* defaultLeftButtonStyle;
12
 @property (strong, nonatomic) RNNButtonOptions* defaultLeftButtonStyle;
13
 @property (strong, nonatomic) RNNButtonOptions* defaultRightButtonStyle;
13
 @property (strong, nonatomic) RNNButtonOptions* defaultRightButtonStyle;
14
-@property (strong, nonatomic) RNNReactComponentManager* componentManager;
14
+@property (strong, nonatomic) RNNReactComponentRegistry* componentRegistry;
15
 @end
15
 @end
16
 
16
 
17
 @implementation RNNNavigationButtons
17
 @implementation RNNNavigationButtons
18
 
18
 
19
--(instancetype)initWithViewController:(UIViewController<RNNLayoutProtocol>*)viewController componentManager:(id)componentManager {
19
+-(instancetype)initWithViewController:(UIViewController<RNNLayoutProtocol>*)viewController componentRegistry:(id)componentRegistry {
20
 	self = [super init];
20
 	self = [super init];
21
 	
21
 	
22
 	self.viewController = viewController;
22
 	self.viewController = viewController;
23
-	self.componentManager = componentManager;
23
+	self.componentRegistry = componentRegistry;
24
 	
24
 	
25
 	return self;
25
 	return self;
26
 }
26
 }
101
 		componentOptions.componentId = [[Text alloc] initWithValue:component[@"componentId"]];
101
 		componentOptions.componentId = [[Text alloc] initWithValue:component[@"componentId"]];
102
 		componentOptions.name = [[Text alloc] initWithValue:component[@"name"]];
102
 		componentOptions.name = [[Text alloc] initWithValue:component[@"name"]];
103
 		
103
 		
104
-		RNNReactView *view = [_componentManager createComponentIfNotExists:componentOptions parentComponentId:self.viewController.layoutInfo.componentId reactViewReadyBlock:nil];
104
+		RNNReactView *view = [_componentRegistry createComponentIfNotExists:componentOptions parentComponentId:self.viewController.layoutInfo.componentId reactViewReadyBlock:nil];
105
 		barButtonItem = [[RNNUIBarButtonItem alloc] init:buttonId withCustomView:view];
105
 		barButtonItem = [[RNNUIBarButtonItem alloc] init:buttonId withCustomView:view];
106
 	} else if (iconImage) {
106
 	} else if (iconImage) {
107
 		barButtonItem = [[RNNUIBarButtonItem alloc] init:buttonId withIcon:iconImage];
107
 		barButtonItem = [[RNNUIBarButtonItem alloc] init:buttonId withIcon:iconImage];

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

42
 }
42
 }
43
 
43
 
44
 - (RNNNavigationOptions *)resolveOptions {
44
 - (RNNNavigationOptions *)resolveOptions {
45
-	return [(RNNNavigationOptions *)[self.getCurrentChild.resolveOptions.copy mergeOptions:self.options] withDefault:self.defaultOptions];
45
+	return [(RNNNavigationOptions *)[self.options mergeInOptions:self.getCurrentChild.resolveOptions.copy] withDefault:self.defaultOptions];
46
 }
46
 }
47
 
47
 
48
 - (void)mergeOptions:(RNNNavigationOptions *)options {
48
 - (void)mergeOptions:(RNNNavigationOptions *)options {
118
 	return ((UIViewController<RNNParentProtocol>*)self.topViewController);
118
 	return ((UIViewController<RNNParentProtocol>*)self.topViewController);
119
 }
119
 }
120
 
120
 
121
-- (UIViewController<RNNLeafProtocol> *)getCurrentLeaf {
122
-	return [[self getCurrentChild] getCurrentLeaf];
123
-}
124
-
125
 - (UIViewController *)childViewControllerForStatusBarStyle {
121
 - (UIViewController *)childViewControllerForStatusBarStyle {
126
 	return self.topViewController;
122
 	return self.topViewController;
127
 }
123
 }

+ 2
- 2
lib/ios/RNNNavigationControllerPresenter.h View File

1
 #import "RNNBasePresenter.h"
1
 #import "RNNBasePresenter.h"
2
 #import "RNNRootViewCreator.h"
2
 #import "RNNRootViewCreator.h"
3
-#import "RNNReactComponentManager.h"
3
+#import "RNNReactComponentRegistry.h"
4
 
4
 
5
 @interface RNNNavigationControllerPresenter : RNNBasePresenter
5
 @interface RNNNavigationControllerPresenter : RNNBasePresenter
6
 
6
 
7
-- (instancetype)initWithComponentManager:(RNNReactComponentManager *)componentManager;
7
+- (instancetype)initWithcomponentRegistry:(RNNReactComponentRegistry *)componentRegistry;
8
 
8
 
9
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options;
9
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options;
10
 
10
 

+ 6
- 6
lib/ios/RNNNavigationControllerPresenter.m View File

5
 #import "RNNCustomTitleView.h"
5
 #import "RNNCustomTitleView.h"
6
 
6
 
7
 @interface RNNNavigationControllerPresenter() {
7
 @interface RNNNavigationControllerPresenter() {
8
-	RNNReactComponentManager* _componentManager;
8
+	RNNReactComponentRegistry* _componentRegistry;
9
 	UIView* _customTopBar;
9
 	UIView* _customTopBar;
10
 	UIView* _customTopBarBackground;
10
 	UIView* _customTopBarBackground;
11
 }
11
 }
13
 @end
13
 @end
14
 @implementation RNNNavigationControllerPresenter
14
 @implementation RNNNavigationControllerPresenter
15
 
15
 
16
-- (instancetype)initWithComponentManager:(RNNReactComponentManager *)componentManager {
16
+- (instancetype)initWithcomponentRegistry:(RNNReactComponentRegistry *)componentRegistry {
17
 	self = [super init];
17
 	self = [super init];
18
-	_componentManager = componentManager;
18
+	_componentRegistry = componentRegistry;
19
 	return self;
19
 	return self;
20
 }
20
 }
21
 
21
 
174
 		readyBlock = nil;
174
 		readyBlock = nil;
175
 	}
175
 	}
176
 	if (options.topBar.component.name.hasValue) {
176
 	if (options.topBar.component.name.hasValue) {
177
-		RCTRootView *reactView = [_componentManager createComponentIfNotExists:options.topBar.component parentComponentId:navigationController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
177
+		RCTRootView *reactView = [_componentRegistry createComponentIfNotExists:options.topBar.component parentComponentId:navigationController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
178
 		
178
 		
179
 		_customTopBar = [[RNNCustomTitleView alloc] initWithFrame:navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
179
 		_customTopBar = [[RNNCustomTitleView alloc] initWithFrame:navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
180
 		reactView.backgroundColor = UIColor.clearColor;
180
 		reactView.backgroundColor = UIColor.clearColor;
195
 		readyBlock = nil;
195
 		readyBlock = nil;
196
 	}
196
 	}
197
 	if (options.topBar.background.component.name.hasValue) {
197
 	if (options.topBar.background.component.name.hasValue) {
198
-		RCTRootView *reactView = [_componentManager createComponentIfNotExists:options.topBar.background.component parentComponentId:navigationController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
198
+		RCTRootView *reactView = [_componentRegistry createComponentIfNotExists:options.topBar.background.component parentComponentId:navigationController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
199
 		
199
 		
200
 		_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
200
 		_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
201
 		[navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];
201
 		[navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];
209
 
209
 
210
 - (void)dealloc {
210
 - (void)dealloc {
211
 	RNNNavigationController* navigationController = self.bindedViewController;
211
 	RNNNavigationController* navigationController = self.bindedViewController;
212
-	[_componentManager removeComponent:navigationController.layoutInfo.componentId];
212
+	[_componentRegistry removeComponent:navigationController.layoutInfo.componentId];
213
 }
213
 }
214
 
214
 
215
 @end
215
 @end

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

15
 
15
 
16
 - (RNNOptions *)overrideOptions:(RNNOptions *)otherOptions;
16
 - (RNNOptions *)overrideOptions:(RNNOptions *)otherOptions;
17
 - (RNNOptions *)mergeOptions:(RNNOptions *)otherOptions;
17
 - (RNNOptions *)mergeOptions:(RNNOptions *)otherOptions;
18
+- (RNNOptions *)mergeInOptions:(RNNOptions *)otherOptions;
18
 
19
 
19
 - (RNNOptions *)withDefault:(RNNOptions *)defaultOptions;
20
 - (RNNOptions *)withDefault:(RNNOptions *)defaultOptions;
20
 
21
 

+ 8
- 0
lib/ios/RNNOptions.m View File

34
 	return [self mergeOptions:otherOptions overrideOptions:NO];
34
 	return [self mergeOptions:otherOptions overrideOptions:NO];
35
 }
35
 }
36
 
36
 
37
+- (RNNOptions *)mergeInOptions:(RNNOptions *)otherOptions {
38
+	if (!otherOptions) {
39
+		return self;
40
+	}
41
+	
42
+	return [otherOptions mergeOptions:self overrideOptions:NO];
43
+}
44
+
37
 - (RNNOptions *)withDefault:(RNNOptions *)defaultOptions {
45
 - (RNNOptions *)withDefault:(RNNOptions *)defaultOptions {
38
 	RNNOptions* newOptions = [[[self class] alloc] initWithDict:@{}];
46
 	RNNOptions* newOptions = [[[self class] alloc] initWithDict:@{}];
39
 	[newOptions mergeOptions:defaultOptions overrideOptions:YES];
47
 	[newOptions mergeOptions:defaultOptions overrideOptions:YES];

lib/ios/RNNReactComponentManager.h → lib/ios/RNNReactComponentRegistry.h View File

4
 #import "RNNStore.h"
4
 #import "RNNStore.h"
5
 #import "RNNRootViewCreator.h"
5
 #import "RNNRootViewCreator.h"
6
 
6
 
7
-@interface RNNReactComponentManager : NSObject
7
+@interface RNNReactComponentRegistry : NSObject
8
 
8
 
9
 - (instancetype)initWithCreator:(id<RNNRootViewCreator>)creator;
9
 - (instancetype)initWithCreator:(id<RNNRootViewCreator>)creator;
10
 
10
 

lib/ios/RNNReactComponentManager.m → lib/ios/RNNReactComponentRegistry.m View File

1
-#import "RNNReactComponentManager.h"
1
+#import "RNNReactComponentRegistry.h"
2
 
2
 
3
-@interface RNNReactComponentManager () {
3
+@interface RNNReactComponentRegistry () {
4
 	id<RNNRootViewCreator> _creator;
4
 	id<RNNRootViewCreator> _creator;
5
 	NSMutableDictionary* _componentStore;
5
 	NSMutableDictionary* _componentStore;
6
 }
6
 }
7
 
7
 
8
 @end
8
 @end
9
 
9
 
10
-@implementation RNNReactComponentManager
10
+@implementation RNNReactComponentRegistry
11
 
11
 
12
 - (instancetype)initWithCreator:(id<RNNRootViewCreator>)creator {
12
 - (instancetype)initWithCreator:(id<RNNRootViewCreator>)creator {
13
 	self = [super init];
13
 	self = [super init];

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

105
 			}
105
 			}
106
 		}];
106
 		}];
107
 	}];
107
 	}];
108
-	reactView.backgroundColor = [UIColor clearColor];
108
+
109
 	self.view = reactView;
109
 	self.view = reactView;
110
 	
110
 	
111
 	if (!wait && readyBlock) {
111
 	if (!wait && readyBlock) {
118
 	return self;
118
 	return self;
119
 }
119
 }
120
 
120
 
121
-- (UIViewController<RNNLeafProtocol> *)getCurrentLeaf {
122
-	return self;
123
-}
124
-
125
 -(void)updateSearchResultsForSearchController:(UISearchController *)searchController {
121
 -(void)updateSearchResultsForSearchController:(UISearchController *)searchController {
126
 	[self.eventEmitter sendOnSearchBarUpdated:self.layoutInfo.componentId
122
 	[self.eventEmitter sendOnSearchBarUpdated:self.layoutInfo.componentId
127
 										 text:searchController.searchBar.text
123
 										 text:searchController.searchBar.text

+ 1
- 5
lib/ios/RNNSideMenuChildVC.m View File

40
 }
40
 }
41
 
41
 
42
 - (RNNNavigationOptions *)resolveOptions {
42
 - (RNNNavigationOptions *)resolveOptions {
43
-	return [(RNNNavigationOptions *)[self.getCurrentChild.resolveOptions.copy mergeOptions:self.options] withDefault:self.defaultOptions];
43
+	return [(RNNNavigationOptions *)[self.options mergeInOptions:self.getCurrentChild.resolveOptions.copy] withDefault:self.defaultOptions];
44
 }
44
 }
45
 
45
 
46
 - (void)mergeOptions:(RNNNavigationOptions *)options {
46
 - (void)mergeOptions:(RNNNavigationOptions *)options {
74
 	return self.child;
74
 	return self.child;
75
 }
75
 }
76
 
76
 
77
-- (UIViewController<RNNLeafProtocol> *)getCurrentLeaf {
78
-	return [[self getCurrentChild] getCurrentLeaf];
79
-}
80
-
81
 - (UIStatusBarStyle)preferredStatusBarStyle {
77
 - (UIStatusBarStyle)preferredStatusBarStyle {
82
 	return self.child.preferredStatusBarStyle;
78
 	return self.child.preferredStatusBarStyle;
83
 }
79
 }

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

48
 }
48
 }
49
 
49
 
50
 - (RNNNavigationOptions *)resolveOptions {
50
 - (RNNNavigationOptions *)resolveOptions {
51
-	return [(RNNNavigationOptions *)[self.getCurrentChild.resolveOptions.copy mergeOptions:self.options] withDefault:self.defaultOptions];
51
+	return [(RNNNavigationOptions *)[self.options mergeInOptions:self.getCurrentChild.resolveOptions.copy] withDefault:self.defaultOptions];
52
 }
52
 }
53
 
53
 
54
 - (void)mergeOptions:(RNNNavigationOptions *)options {
54
 - (void)mergeOptions:(RNNNavigationOptions *)options {
181
 	return self.center;
181
 	return self.center;
182
 }
182
 }
183
 
183
 
184
-- (UIViewController<RNNLeafProtocol> *)getCurrentLeaf {
185
-	return [[self getCurrentChild] getCurrentLeaf];
186
-}
187
-
188
 @end
184
 @end

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

33
 }
33
 }
34
 
34
 
35
 - (RNNNavigationOptions *)resolveOptions {
35
 - (RNNNavigationOptions *)resolveOptions {
36
-	return [(RNNNavigationOptions *)[self.getCurrentChild.resolveOptions.copy mergeOptions:self.options] withDefault:self.defaultOptions];
36
+	return [(RNNNavigationOptions *)[self.options mergeInOptions:self.getCurrentChild.resolveOptions.copy] withDefault:self.defaultOptions];
37
 }
37
 }
38
 
38
 
39
 - (void)mergeOptions:(RNNNavigationOptions *)options {
39
 - (void)mergeOptions:(RNNNavigationOptions *)options {
79
 	return self.viewControllers[0];
79
 	return self.viewControllers[0];
80
 }
80
 }
81
 
81
 
82
-- (UIViewController<RNNLeafProtocol> *)getCurrentLeaf {
83
-	return [[self getCurrentChild] getCurrentLeaf];
84
-}
85
-
86
-
87
 @end
82
 @end

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

48
 }
48
 }
49
 
49
 
50
 - (RNNNavigationOptions *)resolveOptions {
50
 - (RNNNavigationOptions *)resolveOptions {
51
-	return [(RNNNavigationOptions *)[self.getCurrentChild.resolveOptions.copy mergeOptions:self.options] withDefault:self.defaultOptions];
51
+	return [(RNNNavigationOptions *)[self.options mergeInOptions:self.getCurrentChild.resolveOptions.copy] withDefault:self.defaultOptions];
52
 }
52
 }
53
 
53
 
54
 - (void)mergeOptions:(RNNNavigationOptions *)options {
54
 - (void)mergeOptions:(RNNNavigationOptions *)options {
103
 	return self.selectedViewController;
103
 	return self.selectedViewController;
104
 }
104
 }
105
 
105
 
106
-- (UIViewController<RNNLeafProtocol> *)getCurrentLeaf {
107
-	return [[self getCurrentChild] getCurrentLeaf];
108
-}
109
-
110
 - (UIStatusBarStyle)preferredStatusBarStyle {
106
 - (UIStatusBarStyle)preferredStatusBarStyle {
111
 	return ((UIViewController<RNNParentProtocol>*)self.selectedViewController).preferredStatusBarStyle;
107
 	return ((UIViewController<RNNParentProtocol>*)self.selectedViewController).preferredStatusBarStyle;
112
 }
108
 }

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

46
 }
46
 }
47
 
47
 
48
 - (RNNNavigationOptions *)resolveOptions {
48
 - (RNNNavigationOptions *)resolveOptions {
49
-	return [(RNNNavigationOptions *)[self.getCurrentChild.resolveOptions.copy mergeOptions:self.options] withDefault:self.defaultOptions];
49
+	return [(RNNNavigationOptions *)[self.options mergeInOptions:self.getCurrentChild.resolveOptions.copy] withDefault:self.defaultOptions];
50
 }
50
 }
51
 
51
 
52
 - (void)mergeOptions:(RNNNavigationOptions *)options {
52
 - (void)mergeOptions:(RNNNavigationOptions *)options {
132
 	return _currentViewController;
132
 	return _currentViewController;
133
 }
133
 }
134
 
134
 
135
-- (UIViewController<RNNLeafProtocol> *)getCurrentLeaf {
136
-	return [[self getCurrentChild] getCurrentLeaf];
137
-}
138
-
139
 @end
135
 @end

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

7
 @property (nonatomic, strong) RNNScreenTransition* push;
7
 @property (nonatomic, strong) RNNScreenTransition* push;
8
 @property (nonatomic, strong) RNNScreenTransition* pop;
8
 @property (nonatomic, strong) RNNScreenTransition* pop;
9
 @property (nonatomic, strong) RNNScreenTransition* showModal;
9
 @property (nonatomic, strong) RNNScreenTransition* showModal;
10
-@property (nonatomic, strong) RNNScreenTransition* showOverlay;
11
 @property (nonatomic, strong) RNNScreenTransition* dismissModal;
10
 @property (nonatomic, strong) RNNScreenTransition* dismissModal;
12
 @property (nonatomic, strong) RNNScreenTransition* setStackRoot;
11
 @property (nonatomic, strong) RNNScreenTransition* setStackRoot;
13
 @property (nonatomic, strong) RNNScreenTransition* setRoot;
12
 @property (nonatomic, strong) RNNScreenTransition* setRoot;

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

8
 	self.push = [[RNNScreenTransition alloc] initWithDict:dict[@"push"]];
8
 	self.push = [[RNNScreenTransition alloc] initWithDict:dict[@"push"]];
9
 	self.pop = [[RNNScreenTransition alloc] initWithDict:dict[@"pop"]];
9
 	self.pop = [[RNNScreenTransition alloc] initWithDict:dict[@"pop"]];
10
 	self.showModal = [[RNNScreenTransition alloc] initWithDict:dict[@"showModal"]];
10
 	self.showModal = [[RNNScreenTransition alloc] initWithDict:dict[@"showModal"]];
11
-	self.showOverlay = [[RNNScreenTransition alloc] initWithDict:dict[@"showOverlay"]];
12
 	self.dismissModal = [[RNNScreenTransition alloc] initWithDict:dict[@"dismissModal"]];
11
 	self.dismissModal = [[RNNScreenTransition alloc] initWithDict:dict[@"dismissModal"]];
13
 	self.setStackRoot = [[RNNScreenTransition alloc] initWithDict:dict[@"setStackRoot"]];
12
 	self.setStackRoot = [[RNNScreenTransition alloc] initWithDict:dict[@"setStackRoot"]];
14
 	self.setRoot = [[RNNScreenTransition alloc] initWithDict:dict[@"setRoot"]];
13
 	self.setRoot = [[RNNScreenTransition alloc] initWithDict:dict[@"setRoot"]];

+ 2
- 2
lib/ios/RNNViewControllerPresenter.h View File

1
 #import "RNNBasePresenter.h"
1
 #import "RNNBasePresenter.h"
2
 #import "RNNNavigationButtons.h"
2
 #import "RNNNavigationButtons.h"
3
-#import "RNNReactComponentManager.h"
3
+#import "RNNReactComponentRegistry.h"
4
 
4
 
5
 @interface RNNViewControllerPresenter : RNNBasePresenter
5
 @interface RNNViewControllerPresenter : RNNBasePresenter
6
 
6
 
7
-- (instancetype)initWithComponentManager:(RNNReactComponentManager *)componentManager;
7
+- (instancetype)initWithcomponentRegistry:(RNNReactComponentRegistry *)componentRegistry;
8
 
8
 
9
 - (void)renderComponents:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock;
9
 - (void)renderComponents:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock;
10
 
10
 

+ 6
- 6
lib/ios/RNNViewControllerPresenter.m View File

9
 @interface RNNViewControllerPresenter() {
9
 @interface RNNViewControllerPresenter() {
10
 	RNNReactView* _customTitleView;
10
 	RNNReactView* _customTitleView;
11
 	RNNTitleViewHelper* _titleViewHelper;
11
 	RNNTitleViewHelper* _titleViewHelper;
12
-	RNNReactComponentManager* _componentManager;
12
+	RNNReactComponentRegistry* _componentRegistry;
13
 }
13
 }
14
 
14
 
15
 @end
15
 @end
26
 	return self;
26
 	return self;
27
 }
27
 }
28
 
28
 
29
-- (instancetype)initWithComponentManager:(RNNReactComponentManager *)componentManager {
29
+- (instancetype)initWithcomponentRegistry:(RNNReactComponentRegistry *)componentRegistry {
30
 	self = [self init];
30
 	self = [self init];
31
-	_componentManager = componentManager;
31
+	_componentRegistry = componentRegistry;
32
 	return self;
32
 	return self;
33
 }
33
 }
34
 
34
 
35
 - (void)bindViewController:(UIViewController *)bindedViewController {
35
 - (void)bindViewController:(UIViewController *)bindedViewController {
36
 	self.bindedViewController = bindedViewController;
36
 	self.bindedViewController = bindedViewController;
37
-	_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:self.bindedViewController componentManager:_componentManager];
37
+	_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:self.bindedViewController componentRegistry:_componentRegistry];
38
 }
38
 }
39
 
39
 
40
 - (void)applyOptions:(RNNNavigationOptions *)options {
40
 - (void)applyOptions:(RNNNavigationOptions *)options {
154
 		rootView.passThroughTouches = !newOptions.overlay.interceptTouchOutside.get;
154
 		rootView.passThroughTouches = !newOptions.overlay.interceptTouchOutside.get;
155
 	}
155
 	}
156
 	
156
 	
157
-	[self setTitleViewWithSubtitle:newOptions];
157
+	[self setTitleViewWithSubtitle:(RNNNavigationOptions *)[[currentOptions overrideOptions:newOptions] mergeOptions:defaultOptions]];
158
 	
158
 	
159
 	if (newOptions.topBar.title.component.name.hasValue) {
159
 	if (newOptions.topBar.title.component.name.hasValue) {
160
 		[self setCustomNavigationTitleView:newOptions perform:nil];
160
 		[self setCustomNavigationTitleView:newOptions perform:nil];
173
 	}
173
 	}
174
 	
174
 	
175
 	if (options.topBar.title.component.name.hasValue) {
175
 	if (options.topBar.title.component.name.hasValue) {
176
-		_customTitleView = (RNNReactView*)[_componentManager createComponentIfNotExists:options.topBar.title.component parentComponentId:viewController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
176
+		_customTitleView = (RNNReactView*)[_componentRegistry createComponentIfNotExists:options.topBar.title.component parentComponentId:viewController.layoutInfo.componentId reactViewReadyBlock:readyBlock];
177
 		_customTitleView.backgroundColor = UIColor.clearColor;
177
 		_customTitleView.backgroundColor = UIColor.clearColor;
178
 		NSString* alignment = [options.topBar.title.component.alignment getWithDefaultValue:@""];
178
 		NSString* alignment = [options.topBar.title.component.alignment getWithDefaultValue:@""];
179
 		[_customTitleView setAlignment:alignment];
179
 		[_customTitleView setAlignment:alignment];

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

166
 		504AFE751FFFF0540076E904 /* RNNTopTabsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */; };
166
 		504AFE751FFFF0540076E904 /* RNNTopTabsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */; };
167
 		504AFE761FFFF1E00076E904 /* RNNNavigationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E83BAD691F27362500A9F3DD /* RNNNavigationOptions.h */; };
167
 		504AFE761FFFF1E00076E904 /* RNNNavigationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E83BAD691F27362500A9F3DD /* RNNNavigationOptions.h */; };
168
 		504AFE771FFFF1E20076E904 /* RNNTopBarOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */; };
168
 		504AFE771FFFF1E20076E904 /* RNNTopBarOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */; };
169
-		5050465421F8F4490035497A /* RNNReactComponentManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5050465221F8F4490035497A /* RNNReactComponentManager.h */; };
170
-		5050465521F8F4490035497A /* RNNReactComponentManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5050465321F8F4490035497A /* RNNReactComponentManager.m */; };
169
+		5050465421F8F4490035497A /* RNNReactComponentRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5050465221F8F4490035497A /* RNNReactComponentRegistry.h */; };
170
+		5050465521F8F4490035497A /* RNNReactComponentRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 5050465321F8F4490035497A /* RNNReactComponentRegistry.m */; };
171
 		5053CE7F2175FB1900D0386B /* RNNDefaultOptionsHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 5053CE7D2175FB1900D0386B /* RNNDefaultOptionsHelper.h */; };
171
 		5053CE7F2175FB1900D0386B /* RNNDefaultOptionsHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 5053CE7D2175FB1900D0386B /* RNNDefaultOptionsHelper.h */; };
172
 		5053CE802175FB1900D0386B /* RNNDefaultOptionsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 5053CE7E2175FB1900D0386B /* RNNDefaultOptionsHelper.m */; };
172
 		5053CE802175FB1900D0386B /* RNNDefaultOptionsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 5053CE7E2175FB1900D0386B /* RNNDefaultOptionsHelper.m */; };
173
 		50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50570B242061473D006A1B5C /* RNNTitleOptions.h */; };
173
 		50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50570B242061473D006A1B5C /* RNNTitleOptions.h */; };
498
 		504AFE631FFE53070076E904 /* RNNOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOptions.m; sourceTree = "<group>"; };
498
 		504AFE631FFE53070076E904 /* RNNOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOptions.m; sourceTree = "<group>"; };
499
 		504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsOptions.h; sourceTree = "<group>"; };
499
 		504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsOptions.h; sourceTree = "<group>"; };
500
 		504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopTabsOptions.m; sourceTree = "<group>"; };
500
 		504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopTabsOptions.m; sourceTree = "<group>"; };
501
-		5050465221F8F4490035497A /* RNNReactComponentManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNReactComponentManager.h; sourceTree = "<group>"; };
502
-		5050465321F8F4490035497A /* RNNReactComponentManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNReactComponentManager.m; sourceTree = "<group>"; };
501
+		5050465221F8F4490035497A /* RNNReactComponentRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNReactComponentRegistry.h; sourceTree = "<group>"; };
502
+		5050465321F8F4490035497A /* RNNReactComponentRegistry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNReactComponentRegistry.m; sourceTree = "<group>"; };
503
 		5053CE7D2175FB1900D0386B /* RNNDefaultOptionsHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNDefaultOptionsHelper.h; sourceTree = "<group>"; };
503
 		5053CE7D2175FB1900D0386B /* RNNDefaultOptionsHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNDefaultOptionsHelper.h; sourceTree = "<group>"; };
504
 		5053CE7E2175FB1900D0386B /* RNNDefaultOptionsHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNDefaultOptionsHelper.m; sourceTree = "<group>"; };
504
 		5053CE7E2175FB1900D0386B /* RNNDefaultOptionsHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNDefaultOptionsHelper.m; sourceTree = "<group>"; };
505
 		50570B242061473D006A1B5C /* RNNTitleOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTitleOptions.h; sourceTree = "<group>"; };
505
 		50570B242061473D006A1B5C /* RNNTitleOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTitleOptions.h; sourceTree = "<group>"; };
984
 				261F0E691E6F028A00989DE2 /* RNNNavigationStackManager.m */,
984
 				261F0E691E6F028A00989DE2 /* RNNNavigationStackManager.m */,
985
 				50D031322005149000386B3D /* RNNOverlayManager.h */,
985
 				50D031322005149000386B3D /* RNNOverlayManager.h */,
986
 				50D031332005149000386B3D /* RNNOverlayManager.m */,
986
 				50D031332005149000386B3D /* RNNOverlayManager.m */,
987
-				5050465221F8F4490035497A /* RNNReactComponentManager.h */,
988
-				5050465321F8F4490035497A /* RNNReactComponentManager.m */,
987
+				5050465221F8F4490035497A /* RNNReactComponentRegistry.h */,
988
+				5050465321F8F4490035497A /* RNNReactComponentRegistry.m */,
989
 			);
989
 			);
990
 			name = Managers;
990
 			name = Managers;
991
 			sourceTree = "<group>";
991
 			sourceTree = "<group>";
1292
 				5012242221736883000F5F98 /* NullColor.h in Headers */,
1292
 				5012242221736883000F5F98 /* NullColor.h in Headers */,
1293
 				50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */,
1293
 				50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */,
1294
 				50395593217485B000B0A663 /* Double.h in Headers */,
1294
 				50395593217485B000B0A663 /* Double.h in Headers */,
1295
-				5050465421F8F4490035497A /* RNNReactComponentManager.h in Headers */,
1295
+				5050465421F8F4490035497A /* RNNReactComponentRegistry.h in Headers */,
1296
 				504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
1296
 				504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
1297
 				E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
1297
 				E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
1298
 				5049594A216F5FE6006D2B81 /* NullText.h in Headers */,
1298
 				5049594A216F5FE6006D2B81 /* NullText.h in Headers */,
1476
 				5012242721737278000F5F98 /* NullImage.m in Sources */,
1476
 				5012242721737278000F5F98 /* NullImage.m in Sources */,
1477
 				7B1126A01E2D263F00F9B03B /* RNNEventEmitter.m in Sources */,
1477
 				7B1126A01E2D263F00F9B03B /* RNNEventEmitter.m in Sources */,
1478
 				A7626BFD1FC2FB2C00492FB8 /* RNNTopBarOptions.m in Sources */,
1478
 				A7626BFD1FC2FB2C00492FB8 /* RNNTopBarOptions.m in Sources */,
1479
-				5050465521F8F4490035497A /* RNNReactComponentManager.m in Sources */,
1479
+				5050465521F8F4490035497A /* RNNReactComponentRegistry.m in Sources */,
1480
 				263905CB1E4C6F440023D7D3 /* SidebarLuvocracyAnimation.m in Sources */,
1480
 				263905CB1E4C6F440023D7D3 /* SidebarLuvocracyAnimation.m in Sources */,
1481
 				50570BEB2063E09B006A1B5C /* RNNTitleViewHelper.m in Sources */,
1481
 				50570BEB2063E09B006A1B5C /* RNNTitleViewHelper.m in Sources */,
1482
 				263905E71E4CAC950023D7D3 /* RNNSideMenuChildVC.m in Sources */,
1482
 				263905E71E4CAC950023D7D3 /* RNNSideMenuChildVC.m in Sources */,

+ 1
- 1
lib/ios/ReactNativeNavigationTests/RNNCommandsHandlerTest.m View File

62
 	self.store = [OCMockObject partialMockForObject:[[RNNStore alloc] init]];
62
 	self.store = [OCMockObject partialMockForObject:[[RNNStore alloc] init]];
63
 	self.eventEmmiter = [OCMockObject partialMockForObject:[RNNEventEmitter new]];
63
 	self.eventEmmiter = [OCMockObject partialMockForObject:[RNNEventEmitter new]];
64
 	self.overlayManager = [OCMockObject partialMockForObject:[RNNOverlayManager new]];
64
 	self.overlayManager = [OCMockObject partialMockForObject:[RNNOverlayManager new]];
65
-	self.controllerFactory = [OCMockObject partialMockForObject:[[RNNControllerFactory alloc] initWithRootViewCreator:nil eventEmitter:self.eventEmmiter store:self.store componentManager:nil andBridge:nil]];
65
+	self.controllerFactory = [OCMockObject partialMockForObject:[[RNNControllerFactory alloc] initWithRootViewCreator:nil eventEmitter:self.eventEmmiter store:self.store componentRegistry:nil andBridge:nil]];
66
 	self.uut = [[RNNCommandsHandler alloc] initWithStore:self.store controllerFactory:self.controllerFactory eventEmitter:self.eventEmmiter stackManager:[RNNNavigationStackManager new] modalManager:[RNNModalManager new] overlayManager:self.overlayManager mainWindow:_mainWindow];
66
 	self.uut = [[RNNCommandsHandler alloc] initWithStore:self.store controllerFactory:self.controllerFactory eventEmitter:self.eventEmmiter stackManager:[RNNNavigationStackManager new] modalManager:[RNNModalManager new] overlayManager:self.overlayManager mainWindow:_mainWindow];
67
 	self.vc1 = [RNNRootViewController new];
67
 	self.vc1 = [RNNRootViewController new];
68
 	self.vc2 = [RNNRootViewController new];
68
 	self.vc2 = [RNNRootViewController new];

+ 1
- 1
lib/ios/ReactNativeNavigationTests/RNNControllerFactoryTest.m View File

23
 	[super setUp];
23
 	[super setUp];
24
 	self.creator = nil;
24
 	self.creator = nil;
25
 	self.store = [RNNStore new];
25
 	self.store = [RNNStore new];
26
-	self.factory = [[RNNControllerFactory alloc] initWithRootViewCreator:self.creator eventEmitter:nil store:self.store componentManager:nil andBridge:nil];
26
+	self.factory = [[RNNControllerFactory alloc] initWithRootViewCreator:self.creator eventEmitter:nil store:self.store componentRegistry:nil andBridge:nil];
27
 }
27
 }
28
 
28
 
29
 - (void)tearDown {
29
 - (void)tearDown {

+ 0
- 6
lib/ios/ReactNativeNavigationTests/RNNNavigationControllerTest.m View File

47
 	XCTAssertTrue(self.uut.getCurrentChild == self.uut.topViewController);
47
 	XCTAssertTrue(self.uut.getCurrentChild == self.uut.topViewController);
48
 }
48
 }
49
 
49
 
50
-- (void)testCurrentLeaf_shouldReturnCurrentChildLeaf {
51
-	[[_vc2Mock expect] getCurrentLeaf];
52
-	[self.uut getCurrentLeaf];
53
-	[_vc2Mock verify];
54
-}
55
-
56
 - (void)testGetLeafViewController_shouldReturnTopViewController {
50
 - (void)testGetLeafViewController_shouldReturnTopViewController {
57
 	XCTAssertTrue(self.uut.getCurrentChild == self.uut.topViewController);
51
 	XCTAssertTrue(self.uut.getCurrentChild == self.uut.topViewController);
58
 }
52
 }

+ 0
- 12
lib/ios/ReactNativeNavigationTests/RNNTabBarControllerTest.m View File

77
 	XCTAssertTrue(uut.delegate == uut);
77
 	XCTAssertTrue(uut.delegate == uut);
78
 }
78
 }
79
 
79
 
80
-- (void)testWillMoveToParent_invokePresenterApplyOptionsOnWillMoveToParent {
81
-	[[self.mockTabBarPresenter expect] applyOptionsOnWillMoveToParentViewController:[(RNNTabBarController *)self.mockUut resolveOptions]];
82
-	[self.mockUut willMoveToParentViewController:[UIViewController new]];
83
-	[self.mockTabBarPresenter verify];
84
-}
85
-
86
 - (void)testWillMoveToParent_shouldNotInvokePresenterApplyOptionsOnWillMoveToNilParent {
80
 - (void)testWillMoveToParent_shouldNotInvokePresenterApplyOptionsOnWillMoveToNilParent {
87
 	[[self.mockTabBarPresenter reject] applyOptionsOnWillMoveToParentViewController:[(RNNTabBarController *)self.mockUut options]];
81
 	[[self.mockTabBarPresenter reject] applyOptionsOnWillMoveToParentViewController:[(RNNTabBarController *)self.mockUut options]];
88
 	[self.mockUut willMoveToParentViewController:nil];
82
 	[self.mockUut willMoveToParentViewController:nil];
123
 	[parentMock verify];
117
 	[parentMock verify];
124
 }
118
 }
125
 
119
 
126
-- (void)testGetCurrentLeaf_shouldInvokeSelectedViewControllerGetCurrentLeaf {
127
-	[[self.mockChildViewController expect] getCurrentLeaf];
128
-	[self.mockUut getCurrentLeaf];
129
-	[self.mockChildViewController verify];
130
-}
131
-
132
 - (void)testGetCurrentChild_shouldReturnSelectedViewController {
120
 - (void)testGetCurrentChild_shouldReturnSelectedViewController {
133
 	XCTAssertEqual([self.mockUut getCurrentChild], [(RNNTabBarController *)self.mockUut selectedViewController]);
121
 	XCTAssertEqual([self.mockUut getCurrentChild], [(RNNTabBarController *)self.mockUut selectedViewController]);
134
 }
122
 }