Browse Source

Refactor top bar options (#5756)

* Remove main window backgroundColor
* Better interface for TopBarPresenter
Yogev Ben David 4 years ago
parent
commit
60f836e8a8
36 changed files with 457 additions and 458 deletions
  1. 1
    3
      lib/ios/RNNBasePresenter.h
  2. 1
    1
      lib/ios/RNNBasePresenter.m
  3. 2
    2
      lib/ios/RNNComponentPresenter.m
  4. 1
    1
      lib/ios/RNNControllerFactory.m
  5. 1
    1
      lib/ios/RNNSideMenuController.m
  6. 0
    2
      lib/ios/RNNStackController.h
  7. 0
    5
      lib/ios/RNNStackController.m
  8. 2
    2
      lib/ios/RNNStackPresenter.h
  9. 28
    44
      lib/ios/RNNStackPresenter.m
  10. 0
    6
      lib/ios/ReactNativeNavigation.m
  11. 24
    8
      lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj
  12. 9
    0
      lib/ios/TopBarAppearancePresenter.h
  13. 79
    0
      lib/ios/TopBarAppearancePresenter.m
  14. 18
    0
      lib/ios/TopBarPresenter.h
  15. 128
    0
      lib/ios/TopBarPresenter.m
  16. 8
    0
      lib/ios/TopBarPresenterCreator.h
  17. 14
    0
      lib/ios/TopBarPresenterCreator.m
  18. 0
    15
      lib/ios/UINavigationBar+utils.h
  19. 0
    130
      lib/ios/UINavigationBar+utils.m
  20. 0
    10
      lib/ios/UINavigationController+RNNOptions.h
  21. 0
    38
      lib/ios/UINavigationController+RNNOptions.m
  22. 1
    1
      lib/ios/UIViewController+LayoutProtocol.m
  23. 0
    2
      lib/ios/UIViewController+RNNOptions.h
  24. 0
    19
      lib/ios/UIViewController+RNNOptions.m
  25. 3
    3
      playground/ios/NavigationTests/RNNBasePresenterTest.m
  26. 6
    6
      playground/ios/NavigationTests/RNNComponentPresenterTest.m
  27. 0
    32
      playground/ios/NavigationTests/RNNNavigationControllerTest.m
  28. 52
    44
      playground/ios/NavigationTests/RNNRootViewControllerTest.m
  29. 1
    1
      playground/ios/NavigationTests/RNNSideMenuPresenterTest.m
  30. 42
    24
      playground/ios/NavigationTests/RNNStackPresenterTest.m
  31. 1
    1
      playground/ios/NavigationTests/RNNTabBarPresenterTest.m
  32. 0
    52
      playground/ios/NavigationTests/UINavigationController+RNNOptionsTest.m
  33. 1
    1
      playground/ios/NavigationTests/UIViewController+LayoutProtocolTest.m
  34. 9
    0
      playground/ios/NavigationTests/utils/UIImage+Utils.h
  35. 19
    0
      playground/ios/NavigationTests/utils/UIImage+Utils.m
  36. 6
    4
      playground/ios/playground.xcodeproj/project.pbxproj

+ 1
- 3
lib/ios/RNNBasePresenter.h View File

4
 
4
 
5
 @interface RNNBasePresenter : NSObject
5
 @interface RNNBasePresenter : NSObject
6
 
6
 
7
-@property(nonatomic, weak) id boundViewController;
7
+@property(nonatomic, weak, setter=bindViewController:) UIViewController* boundViewController;
8
 
8
 
9
 @property(nonatomic, strong) NSString *boundComponentId;
9
 @property(nonatomic, strong) NSString *boundComponentId;
10
 
10
 
12
 
12
 
13
 - (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions;
13
 - (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions;
14
 
14
 
15
-- (void)boundViewController:(UIViewController *)boundViewController;
16
-
17
 - (void)setDefaultOptions:(RNNNavigationOptions *)defaultOptions;
15
 - (void)setDefaultOptions:(RNNNavigationOptions *)defaultOptions;
18
 
16
 
19
 - (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions;
17
 - (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions;

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

19
     return self;
19
     return self;
20
 }
20
 }
21
 
21
 
22
-- (void)boundViewController:(UIViewController *)boundViewController {
22
+- (void)bindViewController:(UIViewController *)boundViewController {
23
     self.boundComponentId = boundViewController.layoutInfo.componentId;
23
     self.boundComponentId = boundViewController.layoutInfo.componentId;
24
     _boundViewController = boundViewController;
24
     _boundViewController = boundViewController;
25
 }
25
 }

+ 2
- 2
lib/ios/RNNComponentPresenter.m View File

21
 	return self;
21
 	return self;
22
 }
22
 }
23
 
23
 
24
-- (void)boundViewController:(UIViewController *)boundViewController {
25
-	[super boundViewController:boundViewController];
24
+- (void)bindViewController:(id)boundViewController {
25
+	[super bindViewController:boundViewController];
26
 	_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:self.boundViewController componentRegistry:_componentRegistry];
26
 	_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:self.boundViewController componentRegistry:_componentRegistry];
27
 }
27
 }
28
 
28
 

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

134
 }
134
 }
135
 
135
 
136
 - (UIViewController *)createStack:(RNNLayoutNode*)node {
136
 - (UIViewController *)createStack:(RNNLayoutNode*)node {
137
-	RNNStackPresenter* presenter = [[RNNStackPresenter alloc] initWithComponentRegistry:_componentRegistry :_defaultOptions];
137
+	RNNStackPresenter* presenter = [[RNNStackPresenter alloc] initWithComponentRegistry:_componentRegistry defaultOptions:_defaultOptions];
138
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
138
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node];
139
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]];
139
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]];
140
 	
140
 	

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

16
 	self = [super initWithCenterViewController:self.center leftDrawerViewController:self.left rightDrawerViewController:self.right];
16
 	self = [super initWithCenterViewController:self.center leftDrawerViewController:self.left rightDrawerViewController:self.right];
17
 	
17
 	
18
 	self.presenter = presenter;
18
 	self.presenter = presenter;
19
-    [self.presenter boundViewController:self];
19
+    [self.presenter bindViewController:self];
20
 	
20
 	
21
 	self.defaultOptions = defaultOptions;
21
 	self.defaultOptions = defaultOptions;
22
 	self.options = options;
22
 	self.options = options;

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

7
 
7
 
8
 @property (nonatomic, retain) RNNStackPresenter* presenter;
8
 @property (nonatomic, retain) RNNStackPresenter* presenter;
9
 
9
 
10
-- (void)setTopBarBackgroundColor:(UIColor *)backgroundColor;
11
-
12
 @end
10
 @end

+ 0
- 5
lib/ios/RNNStackController.m View File

1
 #import "RNNStackController.h"
1
 #import "RNNStackController.h"
2
 #import "RNNComponentViewController.h"
2
 #import "RNNComponentViewController.h"
3
-#import "UINavigationBar+utils.h"
4
 
3
 
5
 @implementation RNNStackController
4
 @implementation RNNStackController
6
 
5
 
46
 	return self.topViewController;
45
 	return self.topViewController;
47
 }
46
 }
48
 
47
 
49
-- (void)setTopBarBackgroundColor:(UIColor *)backgroundColor {
50
-	[self.navigationBar rnn_setBackgroundColor:backgroundColor];
51
-}
52
-
53
 @end
48
 @end

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

5
 
5
 
6
 @interface RNNStackPresenter : RNNBasePresenter
6
 @interface RNNStackPresenter : RNNBasePresenter
7
 
7
 
8
-@property(nonatomic, strong) InteractivePopGestureDelegate *interactivePopGestureDelegate;
8
+@property (nonatomic, strong) InteractivePopGestureDelegate *interactivePopGestureDelegate;
9
 
9
 
10
-- (instancetype)initWithComponentRegistry:(RNNReactComponentRegistry *)componentRegistry :(RNNNavigationOptions *)defaultOptions;
10
+- (instancetype)initWithComponentRegistry:(RNNReactComponentRegistry *)componentRegistry defaultOptions:(RNNNavigationOptions *)defaultOptions;
11
 
11
 
12
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options;
12
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options;
13
 
13
 

+ 28
- 44
lib/ios/RNNStackPresenter.m View File

2
 #import "UINavigationController+RNNOptions.h"
2
 #import "UINavigationController+RNNOptions.h"
3
 #import "RNNStackController.h"
3
 #import "RNNStackController.h"
4
 #import "RNNCustomTitleView.h"
4
 #import "RNNCustomTitleView.h"
5
+#import "TopBarPresenterCreator.h"
5
 
6
 
6
 @interface RNNStackPresenter() {
7
 @interface RNNStackPresenter() {
7
 	RNNReactComponentRegistry* _componentRegistry;
8
 	RNNReactComponentRegistry* _componentRegistry;
8
 	UIView* _customTopBar;
9
 	UIView* _customTopBar;
9
 	UIView* _customTopBarBackground;
10
 	UIView* _customTopBarBackground;
10
 	RNNReactView* _customTopBarBackgroundReactView;
11
 	RNNReactView* _customTopBarBackgroundReactView;
12
+    TopBarPresenter* _topBarPresenter;
11
 }
13
 }
12
 
14
 
15
+@property (nonatomic, weak) RNNStackController* stackController;
16
+
13
 @end
17
 @end
14
 @implementation RNNStackPresenter
18
 @implementation RNNStackPresenter
15
 
19
 
16
-- (instancetype)initWithComponentRegistry:(RNNReactComponentRegistry *)componentRegistry:(RNNNavigationOptions *)defaultOptions {
20
+- (instancetype)initWithComponentRegistry:(RNNReactComponentRegistry *)componentRegistry defaultOptions:(RNNNavigationOptions *)defaultOptions {
17
 	self = [super initWithDefaultOptions:defaultOptions];
21
 	self = [super initWithDefaultOptions:defaultOptions];
18
 	_componentRegistry = componentRegistry;
22
 	_componentRegistry = componentRegistry;
19
 	return self;
23
 	return self;
20
 }
24
 }
21
 
25
 
26
+- (void)bindViewController:(UIViewController *)boundViewController {
27
+    [super bindViewController:boundViewController];
28
+    _topBarPresenter = [TopBarPresenterCreator createWithBoundedNavigationController:self.stackController];
29
+}
30
+
31
+- (RNNStackController *)stackController {
32
+    return (RNNStackController *)self.boundViewController;
33
+}
34
+
22
 - (void)applyOptions:(RNNNavigationOptions *)options {
35
 - (void)applyOptions:(RNNNavigationOptions *)options {
23
 	[super applyOptions:options];
36
 	[super applyOptions:options];
24
-	RNNStackController* stack = self.boundViewController;
37
+	RNNStackController* stack = self.stackController;
25
 	RNNNavigationOptions * withDefault = [options withDefault:[self defaultOptions]];
38
 	RNNNavigationOptions * withDefault = [options withDefault:[self defaultOptions]];
26
 	
39
 	
27
 	self.interactivePopGestureDelegate = [InteractivePopGestureDelegate new];
40
 	self.interactivePopGestureDelegate = [InteractivePopGestureDelegate new];
30
 	stack.interactivePopGestureRecognizer.delegate = self.interactivePopGestureDelegate;
43
 	stack.interactivePopGestureRecognizer.delegate = self.interactivePopGestureDelegate;
31
 
44
 
32
     [stack setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle getWithDefaultValue:@"default"]]];
45
     [stack setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle getWithDefaultValue:@"default"]]];
33
-    [stack setNavigationBarTranslucent:[withDefault.topBar.background.translucent getWithDefaultValue:NO]];
34
-    [stack setNavigationBarNoBorder:[withDefault.topBar.noBorder getWithDefaultValue:NO]];
35
-    [stack setTopBarBackgroundColor:[withDefault.topBar.background.color getWithDefaultValue:nil]];
36
 	[stack setInteractivePopGestureEnabled:[withDefault.popGesture getWithDefaultValue:YES]];
46
 	[stack setInteractivePopGestureEnabled:[withDefault.popGesture getWithDefaultValue:YES]];
37
 	[stack setRootBackgroundImage:[withDefault.rootBackgroundImage getWithDefaultValue:nil]];
47
 	[stack setRootBackgroundImage:[withDefault.rootBackgroundImage getWithDefaultValue:nil]];
38
 	[stack setNavigationBarTestId:[withDefault.topBar.testID getWithDefaultValue:nil]];
48
 	[stack setNavigationBarTestId:[withDefault.topBar.testID getWithDefaultValue:nil]];
39
 	[stack setNavigationBarVisible:[withDefault.topBar.visible getWithDefaultValue:YES] animated:[withDefault.topBar.animate getWithDefaultValue:YES]];
49
 	[stack setNavigationBarVisible:[withDefault.topBar.visible getWithDefaultValue:YES] animated:[withDefault.topBar.animate getWithDefaultValue:YES]];
40
 	[stack hideBarsOnScroll:[withDefault.topBar.hideOnScroll getWithDefaultValue:NO]];
50
 	[stack hideBarsOnScroll:[withDefault.topBar.hideOnScroll getWithDefaultValue:NO]];
51
+    
52
+    [_topBarPresenter applyOptions:withDefault.topBar];
53
+    
54
+    [stack setNavigationBarBlur:[withDefault.topBar.background.blur getWithDefaultValue:NO]];
55
+    [stack setNavigationBarLargeTitleVisible:[withDefault.topBar.largeTitle.visible getWithDefaultValue:NO]];
41
 	[stack setNavigationBarClipsToBounds:[withDefault.topBar.background.clipToBounds getWithDefaultValue:NO]];
56
 	[stack setNavigationBarClipsToBounds:[withDefault.topBar.background.clipToBounds getWithDefaultValue:NO]];
42
-	[stack setNavigationBarBlur:[withDefault.topBar.background.blur getWithDefaultValue:NO]];
43
-	[stack setNavigationBarLargeTitleVisible:[withDefault.topBar.largeTitle.visible getWithDefaultValue:NO]];
44
-	[stack setNavigationBarLargeTitleFontFamily:[withDefault.topBar.largeTitle.fontFamily getWithDefaultValue:nil] fontSize:[withDefault.topBar.largeTitle.fontSize getWithDefaultValue:nil] fontWeight:[withDefault.topBar.largeTitle.fontWeight getWithDefaultValue:nil] color:[withDefault.topBar.largeTitle.color getWithDefaultValue:nil]];
45
-	[stack setNavigationBarFontFamily:[withDefault.topBar.title.fontFamily getWithDefaultValue:nil] fontSize:[withDefault.topBar.title.fontSize getWithDefaultValue:nil] fontWeight:[withDefault.topBar.title.fontWeight getWithDefaultValue:nil] color:[withDefault.topBar.title.color getWithDefaultValue:nil]];
46
 	[stack setBackButtonColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil]];
57
 	[stack setBackButtonColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil]];
47
-    [stack setBackButtonIcon:[withDefault.topBar.backButton.icon getWithDefaultValue:nil] withColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil] title:[withDefault.topBar.backButton.title getWithDefaultValue:nil] showTitle:[withDefault.topBar.backButton.showTitle getWithDefaultValue:YES]];
48
 }
58
 }
49
 
59
 
50
 - (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options {
60
 - (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options {
56
 
66
 
57
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options {
67
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options {
58
 	RNNNavigationOptions *withDefault = [options withDefault:[self defaultOptions]];
68
 	RNNNavigationOptions *withDefault = [options withDefault:[self defaultOptions]];
59
-	RNNStackController* navigationController = self.boundViewController;
60
-	[navigationController setTopBarBackgroundColor:[withDefault.topBar.background.color getWithDefaultValue:nil]];
61
-	[navigationController setNavigationBarFontFamily:[withDefault.topBar.title.fontFamily getWithDefaultValue:nil] fontSize:[withDefault.topBar.title.fontSize getWithDefaultValue:nil] fontWeight:[withDefault.topBar.title.fontWeight getWithDefaultValue:nil] color:[withDefault.topBar.title.color getWithDefaultValue:nil]];
69
+	RNNStackController* navigationController = self.stackController;
62
 	[navigationController setNavigationBarLargeTitleVisible:[withDefault.topBar.largeTitle.visible getWithDefaultValue:NO]];
70
 	[navigationController setNavigationBarLargeTitleVisible:[withDefault.topBar.largeTitle.visible getWithDefaultValue:NO]];
63
-    [navigationController setBackButtonIcon:[withDefault.topBar.backButton.icon getWithDefaultValue:nil] withColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil] title:[withDefault.topBar.backButton.title getWithDefaultValue:nil] showTitle:[withDefault.topBar.backButton.showTitle getWithDefaultValue:YES]];
71
+    [_topBarPresenter applyOptionsBeforePopping:options.topBar];
64
 }
72
 }
65
 
73
 
66
 - (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigationOptions *)resolvedOptions {
74
 - (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigationOptions *)resolvedOptions {
67
     [super mergeOptions:options resolvedOptions:resolvedOptions];
75
     [super mergeOptions:options resolvedOptions:resolvedOptions];
68
-	RNNStackController* stack = self.boundViewController;
69
-
70
-    if (options.topBar.background.color.hasValue) {
71
-        [stack setTopBarBackgroundColor:options.topBar.background.color.get];
72
-    }
76
+	RNNStackController* stack = self.stackController;
73
     
77
     
74
 	if (options.popGesture.hasValue) {
78
 	if (options.popGesture.hasValue) {
75
 		[stack setInteractivePopGestureEnabled:options.popGesture.get];
79
 		[stack setInteractivePopGestureEnabled:options.popGesture.get];
91
 		[stack hideBarsOnScroll:[options.topBar.hideOnScroll get]];
95
 		[stack hideBarsOnScroll:[options.topBar.hideOnScroll get]];
92
 	}
96
 	}
93
 	
97
 	
94
-	if (options.topBar.noBorder.hasValue) {
95
-		[stack setNavigationBarNoBorder:[options.topBar.noBorder get]];
96
-	}
97
-	
98
 	if (options.topBar.barStyle.hasValue) {
98
 	if (options.topBar.barStyle.hasValue) {
99
 		[stack setBarStyle:[RCTConvert UIBarStyle:options.topBar.barStyle.get]];
99
 		[stack setBarStyle:[RCTConvert UIBarStyle:options.topBar.barStyle.get]];
100
 	}
100
 	}
101
 	
101
 	
102
-	if (options.topBar.background.translucent.hasValue) {
103
-		[stack setNavigationBarTranslucent:[options.topBar.background.translucent get]];
104
-	}
105
-	
106
 	if (options.topBar.background.clipToBounds.hasValue) {
102
 	if (options.topBar.background.clipToBounds.hasValue) {
107
 		[stack setNavigationBarClipsToBounds:[options.topBar.background.clipToBounds get]];
103
 		[stack setNavigationBarClipsToBounds:[options.topBar.background.clipToBounds get]];
108
 	}
104
 	}
119
 		[stack setBackButtonColor:options.topBar.backButton.color.get];
115
 		[stack setBackButtonColor:options.topBar.backButton.color.get];
120
 	}
116
 	}
121
 
117
 
122
-	RNNLargeTitleOptions *largeTitleOptions = options.topBar.largeTitle;
123
-	if (largeTitleOptions.color.hasValue || largeTitleOptions.fontSize.hasValue || largeTitleOptions.fontFamily.hasValue) {
124
-		[stack setNavigationBarLargeTitleFontFamily:[options.topBar.largeTitle.fontFamily getWithDefaultValue:nil] fontSize:[options.topBar.largeTitle.fontSize getWithDefaultValue:nil] fontWeight:[options.topBar.largeTitle.fontWeight getWithDefaultValue:nil] color:[options.topBar.largeTitle.color getWithDefaultValue:nil]];
125
-	}
126
-
127
-	RNNNavigationOptions * withDefault = (RNNNavigationOptions *) [[options mergeInOptions:resolvedOptions] withDefault:[self defaultOptions]];
128
-	[stack setNavigationBarFontFamily:[withDefault.topBar.title.fontFamily getWithDefaultValue:nil]
129
-							 fontSize:[withDefault.topBar.title.fontSize getWithDefaultValue:nil]
130
-						   fontWeight:[withDefault.topBar.title.fontWeight getWithDefaultValue:nil]
131
-								color:[withDefault.topBar.title.color getWithDefaultValue:nil]];
132
-	
133
 	if (options.topBar.component.name.hasValue) {
118
 	if (options.topBar.component.name.hasValue) {
134
 		[self setCustomNavigationBarView:options perform:nil];
119
 		[self setCustomNavigationBarView:options perform:nil];
135
 	}
120
 	}
138
 		[self setCustomNavigationComponentBackground:options perform:nil];
123
 		[self setCustomNavigationComponentBackground:options perform:nil];
139
 	}
124
 	}
140
     
125
     
141
-    if (options.topBar.backButton.hasValue) {
142
-        [stack setBackButtonIcon:[withDefault.topBar.backButton.icon getWithDefaultValue:nil] withColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil] title:[withDefault.topBar.backButton.title getWithDefaultValue:nil] showTitle:[withDefault.topBar.backButton.showTitle getWithDefaultValue:YES]];
143
-    }
126
+    RNNNavigationOptions * withDefault = (RNNNavigationOptions *) [[options mergeInOptions:resolvedOptions] withDefault:[self defaultOptions]];
127
+    [_topBarPresenter mergeOptions:options.topBar defaultOptions:withDefault.topBar];
144
 }
128
 }
145
 
129
 
146
 - (void)renderComponents:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {
130
 - (void)renderComponents:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {
172
 }
156
 }
173
 
157
 
174
 - (void)setCustomNavigationBarView:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {
158
 - (void)setCustomNavigationBarView:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {
175
-	RNNStackController* stack = self.boundViewController;
159
+	RNNStackController* stack = self.stackController;
176
 	if (![options.topBar.component.waitForRender getWithDefaultValue:NO] && readyBlock) {
160
 	if (![options.topBar.component.waitForRender getWithDefaultValue:NO] && readyBlock) {
177
 		readyBlock();
161
 		readyBlock();
178
 		readyBlock = nil;
162
 		readyBlock = nil;
199
 
183
 
200
 - (void)setCustomNavigationComponentBackground:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {
184
 - (void)setCustomNavigationComponentBackground:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {
201
     RNNNavigationOptions *withDefault = [options withDefault:[self defaultOptions]];
185
     RNNNavigationOptions *withDefault = [options withDefault:[self defaultOptions]];
202
-	RNNStackController* stack = self.boundViewController;
186
+	RNNStackController* stack = self.stackController;
203
 	if (![withDefault.topBar.background.component.waitForRender getWithDefaultValue:NO] && readyBlock) {
187
 	if (![withDefault.topBar.background.component.waitForRender getWithDefaultValue:NO] && readyBlock) {
204
 		readyBlock();
188
 		readyBlock();
205
 		readyBlock = nil;
189
 		readyBlock = nil;
219
 }
203
 }
220
 
204
 
221
 - (void)presentBackgroundComponent {
205
 - (void)presentBackgroundComponent {
222
-	RNNStackController* stack = self.boundViewController;
206
+	RNNStackController* stack = self.stackController;
223
 	if (_customTopBarBackground) {
207
 	if (_customTopBarBackground) {
224
 		[_customTopBarBackground removeFromSuperview];
208
 		[_customTopBarBackground removeFromSuperview];
225
 	}
209
 	}

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

67
 
67
 
68
 - (UIWindow *)initializeKeyWindow {
68
 - (UIWindow *)initializeKeyWindow {
69
 	UIWindow* keyWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
69
 	UIWindow* keyWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
70
-	if (@available(iOS 13.0, *)) {
71
-		keyWindow.backgroundColor = [UIColor systemBackgroundColor];
72
-	} else {
73
-		keyWindow.backgroundColor = [UIColor whiteColor];
74
-	}
75
 	UIApplication.sharedApplication.delegate.window = keyWindow;
70
 	UIApplication.sharedApplication.delegate.window = keyWindow;
76
-	
77
 	return keyWindow;
71
 	return keyWindow;
78
 }
72
 }
79
 
73
 

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

228
 		50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */; };
228
 		50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */; };
229
 		50A246372395399700A192C5 /* RNNModalOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50A246352395399700A192C5 /* RNNModalOptions.h */; };
229
 		50A246372395399700A192C5 /* RNNModalOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50A246352395399700A192C5 /* RNNModalOptions.h */; };
230
 		50A246382395399700A192C5 /* RNNModalOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A246362395399700A192C5 /* RNNModalOptions.m */; };
230
 		50A246382395399700A192C5 /* RNNModalOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A246362395399700A192C5 /* RNNModalOptions.m */; };
231
-		50A409CA238D444900D5FF7D /* UINavigationBar+utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50A409C8238D444900D5FF7D /* UINavigationBar+utils.h */; };
232
-		50A409CB238D444900D5FF7D /* UINavigationBar+utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A409C9238D444900D5FF7D /* UINavigationBar+utils.m */; };
233
 		50AB0B1C2255F8640039DAED /* UIViewController+LayoutProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50AB0B1A2255F8640039DAED /* UIViewController+LayoutProtocol.h */; };
231
 		50AB0B1C2255F8640039DAED /* UIViewController+LayoutProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50AB0B1A2255F8640039DAED /* UIViewController+LayoutProtocol.h */; };
234
 		50AB0B1D2255F8640039DAED /* UIViewController+LayoutProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 50AB0B1B2255F8640039DAED /* UIViewController+LayoutProtocol.m */; };
232
 		50AB0B1D2255F8640039DAED /* UIViewController+LayoutProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 50AB0B1B2255F8640039DAED /* UIViewController+LayoutProtocol.m */; };
235
 		50AB0B1F22562FA10039DAED /* UIViewController+LayoutProtocolTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50AB0B1E22562FA10039DAED /* UIViewController+LayoutProtocolTest.m */; };
233
 		50AB0B1F22562FA10039DAED /* UIViewController+LayoutProtocolTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50AB0B1E22562FA10039DAED /* UIViewController+LayoutProtocolTest.m */; };
244
 		50CB3B691FDE911400AA153B /* RNNSideMenuOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */; };
242
 		50CB3B691FDE911400AA153B /* RNNSideMenuOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */; };
245
 		50CB3B6A1FDE911400AA153B /* RNNSideMenuOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */; };
243
 		50CB3B6A1FDE911400AA153B /* RNNSideMenuOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */; };
246
 		50CE8503217C6C9B00084EBF /* RNNSideMenuPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CE8502217C6C9B00084EBF /* RNNSideMenuPresenterTest.m */; };
244
 		50CE8503217C6C9B00084EBF /* RNNSideMenuPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CE8502217C6C9B00084EBF /* RNNSideMenuPresenterTest.m */; };
245
+		50CED449239EA56100C42EE2 /* TopBarPresenterCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 50CED447239EA56100C42EE2 /* TopBarPresenterCreator.h */; };
246
+		50CED44A239EA56100C42EE2 /* TopBarPresenterCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CED448239EA56100C42EE2 /* TopBarPresenterCreator.m */; };
247
+		50CED44D239EA78700C42EE2 /* TopBarAppearancePresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 50CED44B239EA78700C42EE2 /* TopBarAppearancePresenter.h */; };
248
+		50CED44E239EA78700C42EE2 /* TopBarAppearancePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CED44C239EA78700C42EE2 /* TopBarAppearancePresenter.m */; };
249
+		50CED451239F9DFC00C42EE2 /* TopBarPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 50CED44F239F9DFC00C42EE2 /* TopBarPresenter.h */; };
250
+		50CED452239F9DFC00C42EE2 /* TopBarPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CED450239F9DFC00C42EE2 /* TopBarPresenter.m */; };
247
 		50D031342005149000386B3D /* RNNOverlayManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 50D031322005149000386B3D /* RNNOverlayManager.h */; };
251
 		50D031342005149000386B3D /* RNNOverlayManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 50D031322005149000386B3D /* RNNOverlayManager.h */; };
248
 		50D031352005149000386B3D /* RNNOverlayManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 50D031332005149000386B3D /* RNNOverlayManager.m */; };
252
 		50D031352005149000386B3D /* RNNOverlayManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 50D031332005149000386B3D /* RNNOverlayManager.m */; };
249
 		50DE2E45238EA14E005CD5F4 /* NSArray+utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50DE2E43238EA14E005CD5F4 /* NSArray+utils.h */; };
253
 		50DE2E45238EA14E005CD5F4 /* NSArray+utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50DE2E43238EA14E005CD5F4 /* NSArray+utils.h */; };
604
 		50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOverlayOptions.m; sourceTree = "<group>"; };
608
 		50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOverlayOptions.m; sourceTree = "<group>"; };
605
 		50A246352395399700A192C5 /* RNNModalOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNModalOptions.h; sourceTree = "<group>"; };
609
 		50A246352395399700A192C5 /* RNNModalOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNModalOptions.h; sourceTree = "<group>"; };
606
 		50A246362395399700A192C5 /* RNNModalOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNModalOptions.m; sourceTree = "<group>"; };
610
 		50A246362395399700A192C5 /* RNNModalOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNModalOptions.m; sourceTree = "<group>"; };
607
-		50A409C8238D444900D5FF7D /* UINavigationBar+utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UINavigationBar+utils.h"; sourceTree = "<group>"; };
608
-		50A409C9238D444900D5FF7D /* UINavigationBar+utils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UINavigationBar+utils.m"; sourceTree = "<group>"; };
609
 		50AB0B1A2255F8640039DAED /* UIViewController+LayoutProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIViewController+LayoutProtocol.h"; sourceTree = "<group>"; };
611
 		50AB0B1A2255F8640039DAED /* UIViewController+LayoutProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIViewController+LayoutProtocol.h"; sourceTree = "<group>"; };
610
 		50AB0B1B2255F8640039DAED /* UIViewController+LayoutProtocol.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+LayoutProtocol.m"; sourceTree = "<group>"; };
612
 		50AB0B1B2255F8640039DAED /* UIViewController+LayoutProtocol.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+LayoutProtocol.m"; sourceTree = "<group>"; };
611
 		50AB0B1E22562FA10039DAED /* UIViewController+LayoutProtocolTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+LayoutProtocolTest.m"; sourceTree = "<group>"; };
613
 		50AB0B1E22562FA10039DAED /* UIViewController+LayoutProtocolTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+LayoutProtocolTest.m"; sourceTree = "<group>"; };
618
 		50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSideMenuOptions.h; sourceTree = "<group>"; };
620
 		50CB3B671FDE911400AA153B /* RNNSideMenuOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSideMenuOptions.h; sourceTree = "<group>"; };
619
 		50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuOptions.m; sourceTree = "<group>"; };
621
 		50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuOptions.m; sourceTree = "<group>"; };
620
 		50CE8502217C6C9B00084EBF /* RNNSideMenuPresenterTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuPresenterTest.m; sourceTree = "<group>"; };
622
 		50CE8502217C6C9B00084EBF /* RNNSideMenuPresenterTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuPresenterTest.m; sourceTree = "<group>"; };
623
+		50CED447239EA56100C42EE2 /* TopBarPresenterCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TopBarPresenterCreator.h; sourceTree = "<group>"; };
624
+		50CED448239EA56100C42EE2 /* TopBarPresenterCreator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TopBarPresenterCreator.m; sourceTree = "<group>"; };
625
+		50CED44B239EA78700C42EE2 /* TopBarAppearancePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TopBarAppearancePresenter.h; sourceTree = "<group>"; };
626
+		50CED44C239EA78700C42EE2 /* TopBarAppearancePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TopBarAppearancePresenter.m; sourceTree = "<group>"; };
627
+		50CED44F239F9DFC00C42EE2 /* TopBarPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TopBarPresenter.h; sourceTree = "<group>"; };
628
+		50CED450239F9DFC00C42EE2 /* TopBarPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TopBarPresenter.m; sourceTree = "<group>"; };
621
 		50D031322005149000386B3D /* RNNOverlayManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNOverlayManager.h; sourceTree = "<group>"; };
629
 		50D031322005149000386B3D /* RNNOverlayManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNOverlayManager.h; sourceTree = "<group>"; };
622
 		50D031332005149000386B3D /* RNNOverlayManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOverlayManager.m; sourceTree = "<group>"; };
630
 		50D031332005149000386B3D /* RNNOverlayManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOverlayManager.m; sourceTree = "<group>"; };
623
 		50DA74CF232F80FE004A00C1 /* RCTConvert+UIFontWeight.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+UIFontWeight.h"; sourceTree = "<group>"; };
631
 		50DA74CF232F80FE004A00C1 /* RCTConvert+UIFontWeight.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+UIFontWeight.h"; sourceTree = "<group>"; };
1122
 				50570BE92063E09B006A1B5C /* RNNTitleViewHelper.m */,
1130
 				50570BE92063E09B006A1B5C /* RNNTitleViewHelper.m */,
1123
 				501CD31D214A5B6900A6E225 /* RNNLayoutInfo.h */,
1131
 				501CD31D214A5B6900A6E225 /* RNNLayoutInfo.h */,
1124
 				501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */,
1132
 				501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */,
1133
+				50CED447239EA56100C42EE2 /* TopBarPresenterCreator.h */,
1134
+				50CED448239EA56100C42EE2 /* TopBarPresenterCreator.m */,
1135
+				50CED44B239EA78700C42EE2 /* TopBarAppearancePresenter.h */,
1136
+				50CED44C239EA78700C42EE2 /* TopBarAppearancePresenter.m */,
1137
+				50CED44F239F9DFC00C42EE2 /* TopBarPresenter.h */,
1138
+				50CED450239F9DFC00C42EE2 /* TopBarPresenter.m */,
1125
 				501E0215213E7EA3003365C5 /* RNNReactView.h */,
1139
 				501E0215213E7EA3003365C5 /* RNNReactView.h */,
1126
 				501E0216213E7EA3003365C5 /* RNNReactView.m */,
1140
 				501E0216213E7EA3003365C5 /* RNNReactView.m */,
1127
 				26916C961E4B9E7700D13680 /* RNNReactRootViewCreator.h */,
1141
 				26916C961E4B9E7700D13680 /* RNNReactRootViewCreator.h */,
1271
 				E5F6C39F22DB4D0E0093C2CE /* UIView+Utils.m */,
1285
 				E5F6C39F22DB4D0E0093C2CE /* UIView+Utils.m */,
1272
 				E5F6C39D22DB4D0E0093C2CE /* UIViewController+Utils.h */,
1286
 				E5F6C39D22DB4D0E0093C2CE /* UIViewController+Utils.h */,
1273
 				E5F6C39E22DB4D0E0093C2CE /* UIViewController+Utils.m */,
1287
 				E5F6C39E22DB4D0E0093C2CE /* UIViewController+Utils.m */,
1274
-				50A409C8238D444900D5FF7D /* UINavigationBar+utils.h */,
1275
-				50A409C9238D444900D5FF7D /* UINavigationBar+utils.m */,
1276
 				50DE2E43238EA14E005CD5F4 /* NSArray+utils.h */,
1288
 				50DE2E43238EA14E005CD5F4 /* NSArray+utils.h */,
1277
 				50DE2E44238EA14E005CD5F4 /* NSArray+utils.m */,
1289
 				50DE2E44238EA14E005CD5F4 /* NSArray+utils.m */,
1278
 			);
1290
 			);
1426
 				E5F6C3AC22DB4D0F0093C2CE /* UITabBarController+RNNUtils.h in Headers */,
1438
 				E5F6C3AC22DB4D0F0093C2CE /* UITabBarController+RNNUtils.h in Headers */,
1427
 				506317AA220B547400B26FC3 /* UIImage+insets.h in Headers */,
1439
 				506317AA220B547400B26FC3 /* UIImage+insets.h in Headers */,
1428
 				5038A3C6216E2D93009280BC /* Number.h in Headers */,
1440
 				5038A3C6216E2D93009280BC /* Number.h in Headers */,
1441
+				50CED44D239EA78700C42EE2 /* TopBarAppearancePresenter.h in Headers */,
1429
 				50887C1520ECC5C200D06111 /* RNNButtonOptions.h in Headers */,
1442
 				50887C1520ECC5C200D06111 /* RNNButtonOptions.h in Headers */,
1430
 				5049593E216F5D73006D2B81 /* BoolParser.h in Headers */,
1443
 				5049593E216F5D73006D2B81 /* BoolParser.h in Headers */,
1431
 				E5F6C3A522DB4D0F0093C2CE /* UIViewController+Utils.h in Headers */,
1444
 				E5F6C3A522DB4D0F0093C2CE /* UIViewController+Utils.h in Headers */,
1435
 				E8E518321F83B3E0000467AC /* RNNUtils.h in Headers */,
1448
 				E8E518321F83B3E0000467AC /* RNNUtils.h in Headers */,
1436
 				50E5F791223FA04C002AFEAD /* RNNAnimationConfigurationOptions.h in Headers */,
1449
 				50E5F791223FA04C002AFEAD /* RNNAnimationConfigurationOptions.h in Headers */,
1437
 				5049594E216F6277006D2B81 /* NumberParser.h in Headers */,
1450
 				5049594E216F6277006D2B81 /* NumberParser.h in Headers */,
1438
-				50A409CA238D444900D5FF7D /* UINavigationBar+utils.h in Headers */,
1439
 				50BE951320B5A787004F5DF5 /* RNNStatusBarOptions.h in Headers */,
1451
 				50BE951320B5A787004F5DF5 /* RNNStatusBarOptions.h in Headers */,
1440
 				50570BEA2063E09B006A1B5C /* RNNTitleViewHelper.h in Headers */,
1452
 				50570BEA2063E09B006A1B5C /* RNNTitleViewHelper.h in Headers */,
1441
 				50495956216F6B3D006D2B81 /* DictionaryParser.h in Headers */,
1453
 				50495956216F6B3D006D2B81 /* DictionaryParser.h in Headers */,
1448
 				5048862D20BE976D000908DE /* RNNLayoutOptions.h in Headers */,
1460
 				5048862D20BE976D000908DE /* RNNLayoutOptions.h in Headers */,
1449
 				5038A374216CDDB6009280BC /* UIViewController+SideMenuController.h in Headers */,
1461
 				5038A374216CDDB6009280BC /* UIViewController+SideMenuController.h in Headers */,
1450
 				E8A5CD621F49114F00E89D0D /* RNNElement.h in Headers */,
1462
 				E8A5CD621F49114F00E89D0D /* RNNElement.h in Headers */,
1463
+				50CED449239EA56100C42EE2 /* TopBarPresenterCreator.h in Headers */,
1451
 				5012240E21735999000F5F98 /* RNNBasePresenter.h in Headers */,
1464
 				5012240E21735999000F5F98 /* RNNBasePresenter.h in Headers */,
1452
 				50495952216F62BD006D2B81 /* NullNumber.h in Headers */,
1465
 				50495952216F62BD006D2B81 /* NullNumber.h in Headers */,
1453
 				5012242221736883000F5F98 /* NullColor.h in Headers */,
1466
 				5012242221736883000F5F98 /* NullColor.h in Headers */,
1467
+				50CED451239F9DFC00C42EE2 /* TopBarPresenter.h in Headers */,
1454
 				50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */,
1468
 				50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */,
1455
 				5017D9EE239D2FAF00B74047 /* BottomTabsAfterInitialTabAttacher.h in Headers */,
1469
 				5017D9EE239D2FAF00B74047 /* BottomTabsAfterInitialTabAttacher.h in Headers */,
1456
 				50395593217485B000B0A663 /* Double.h in Headers */,
1470
 				50395593217485B000B0A663 /* Double.h in Headers */,
1628
 			files = (
1642
 			files = (
1629
 				50C4A497206BDDBB00DB292E /* RNNSubtitleOptions.m in Sources */,
1643
 				50C4A497206BDDBB00DB292E /* RNNSubtitleOptions.m in Sources */,
1630
 				509416A823A11C630036092C /* EnumParser.m in Sources */,
1644
 				509416A823A11C630036092C /* EnumParser.m in Sources */,
1631
-				50A409CB238D444900D5FF7D /* UINavigationBar+utils.m in Sources */,
1632
 				50AB0B1D2255F8640039DAED /* UIViewController+LayoutProtocol.m in Sources */,
1645
 				50AB0B1D2255F8640039DAED /* UIViewController+LayoutProtocol.m in Sources */,
1633
 				263905B41E4C6F440023D7D3 /* MMDrawerVisualState.m in Sources */,
1646
 				263905B41E4C6F440023D7D3 /* MMDrawerVisualState.m in Sources */,
1634
 				5012240B21735959000F5F98 /* RNNSideMenuPresenter.m in Sources */,
1647
 				5012240B21735959000F5F98 /* RNNSideMenuPresenter.m in Sources */,
1730
 				5039558C2174829400B0A663 /* IntNumberParser.m in Sources */,
1743
 				5039558C2174829400B0A663 /* IntNumberParser.m in Sources */,
1731
 				507F43C61FF4F17C00D9425B /* RNNTopTabsViewController.m in Sources */,
1744
 				507F43C61FF4F17C00D9425B /* RNNTopTabsViewController.m in Sources */,
1732
 				50706E6E20CE7CA5003345C3 /* UIImage+tint.m in Sources */,
1745
 				50706E6E20CE7CA5003345C3 /* UIImage+tint.m in Sources */,
1746
+				50CED452239F9DFC00C42EE2 /* TopBarPresenter.m in Sources */,
1733
 				50344D2923A03DB4004B6A7C /* BottomTabsAttachMode.m in Sources */,
1747
 				50344D2923A03DB4004B6A7C /* BottomTabsAttachMode.m in Sources */,
1734
 				501224072173592D000F5F98 /* RNNBottomTabsPresenter.m in Sources */,
1748
 				501224072173592D000F5F98 /* RNNBottomTabsPresenter.m in Sources */,
1735
 				50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */,
1749
 				50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */,
1745
 				E8367B811F7A8A4700675C05 /* VICMAImageView.m in Sources */,
1759
 				E8367B811F7A8A4700675C05 /* VICMAImageView.m in Sources */,
1746
 				5049594B216F5FE6006D2B81 /* NullText.m in Sources */,
1760
 				5049594B216F5FE6006D2B81 /* NullText.m in Sources */,
1747
 				5047E4F52267568800908DD3 /* RNNExternalComponentStore.m in Sources */,
1761
 				5047E4F52267568800908DD3 /* RNNExternalComponentStore.m in Sources */,
1762
+				50CED44A239EA56100C42EE2 /* TopBarPresenterCreator.m in Sources */,
1748
 				A7626C011FC5796200492FB8 /* RNNBottomTabsOptions.m in Sources */,
1763
 				A7626C011FC5796200492FB8 /* RNNBottomTabsOptions.m in Sources */,
1749
 				5012241721736667000F5F98 /* Color.m in Sources */,
1764
 				5012241721736667000F5F98 /* Color.m in Sources */,
1750
 				263905AF1E4C6F440023D7D3 /* MMDrawerBarButtonItem.m in Sources */,
1765
 				263905AF1E4C6F440023D7D3 /* MMDrawerBarButtonItem.m in Sources */,
1771
 				5012242B217372B3000F5F98 /* ImageParser.m in Sources */,
1786
 				5012242B217372B3000F5F98 /* ImageParser.m in Sources */,
1772
 				30987AB5137F264FA06DA289 /* DotIndicatorOptions.m in Sources */,
1787
 				30987AB5137F264FA06DA289 /* DotIndicatorOptions.m in Sources */,
1773
 				30987D71FB4FEEAC8D8978E8 /* DotIndicatorParser.m in Sources */,
1788
 				30987D71FB4FEEAC8D8978E8 /* DotIndicatorParser.m in Sources */,
1789
+				50CED44E239EA78700C42EE2 /* TopBarAppearancePresenter.m in Sources */,
1774
 				30987B23F288EB3A78B7F27C /* RNNDotIndicatorPresenter.m in Sources */,
1790
 				30987B23F288EB3A78B7F27C /* RNNDotIndicatorPresenter.m in Sources */,
1775
 				5017D9F3239D2FCB00B74047 /* BottomTabsOnSwitchToTabAttacher.m in Sources */,
1791
 				5017D9F3239D2FCB00B74047 /* BottomTabsOnSwitchToTabAttacher.m in Sources */,
1776
 				309878CC9D33CE1CF991EBD1 /* NoColor.m in Sources */,
1792
 				309878CC9D33CE1CF991EBD1 /* NoColor.m in Sources */,

+ 9
- 0
lib/ios/TopBarAppearancePresenter.h View File

1
+#import <UIKit/UIKit.h>
2
+#import "TopBarPresenter.h"
3
+
4
+API_AVAILABLE(ios(13.0))
5
+@interface TopBarAppearancePresenter : TopBarPresenter
6
+
7
+
8
+
9
+@end

+ 79
- 0
lib/ios/TopBarAppearancePresenter.m View File

1
+#import "TopBarAppearancePresenter.h"
2
+#import "RNNFontAttributesCreator.h"
3
+
4
+@interface TopBarAppearancePresenter ()
5
+
6
+@end
7
+
8
+
9
+@implementation TopBarAppearancePresenter {
10
+    UINavigationBarAppearance* _appearance;
11
+}
12
+@synthesize backgroundColor = _backgroundColor;
13
+@synthesize translucent = _translucent;
14
+
15
+- (instancetype)initWithNavigationController:(UINavigationController *)boundNavigationController {
16
+    self = [super initWithNavigationController:boundNavigationController];
17
+    _appearance = boundNavigationController.navigationBar.standardAppearance ?: [UINavigationBarAppearance new];
18
+    boundNavigationController.navigationBar.standardAppearance = _appearance;
19
+    return self;
20
+}
21
+
22
+- (void)setTranslucent:(BOOL)translucent {
23
+    _translucent = translucent;
24
+    [self updateBackgroundAppearance];
25
+}
26
+
27
+- (void)setTransparent:(BOOL)transparent {
28
+    [self updateBackgroundAppearance];
29
+}
30
+
31
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
32
+    _backgroundColor = backgroundColor;
33
+    [self updateBackgroundAppearance];
34
+}
35
+
36
+- (void)updateBackgroundAppearance {
37
+    if (self.transparent) {
38
+        [_appearance configureWithTransparentBackground];
39
+    } else if (_backgroundColor) {
40
+        [_appearance setBackgroundColor:_backgroundColor];
41
+    } else if (_translucent) {
42
+        [_appearance configureWithDefaultBackground];
43
+    } else {
44
+        [_appearance configureWithOpaqueBackground];
45
+    }
46
+}
47
+
48
+- (BOOL)transparent {
49
+    return (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) == 0.0);
50
+}
51
+
52
+- (void)showBorder:(BOOL)showBorder {
53
+    UIColor* shadowColor = showBorder ? [[UINavigationBarAppearance new] shadowColor] : nil;
54
+    _appearance.shadowColor = shadowColor;
55
+}
56
+
57
+- (void)setBackIndicatorImage:(UIImage *)image withColor:(UIColor *)color {
58
+    [_appearance setBackIndicatorImage:image transitionMaskImage:image];
59
+}
60
+
61
+- (void)setTitleAttributes:(RNNTitleOptions *)titleOptions {
62
+    NSString* fontFamily = [titleOptions.fontFamily getWithDefaultValue:nil];
63
+    NSString* fontWeight = [titleOptions.fontWeight getWithDefaultValue:nil];
64
+    NSNumber* fontSize = [titleOptions.fontSize getWithDefaultValue:nil];
65
+    UIColor* fontColor = [titleOptions.color getWithDefaultValue:nil];
66
+    
67
+    _appearance.titleTextAttributes = [RNNFontAttributesCreator createFromDictionary:_appearance.titleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:fontColor defaultColor:nil];
68
+}
69
+
70
+- (void)setLargeTitleAttributes:(RNNLargeTitleOptions *)largeTitleOptions {
71
+    NSString* fontFamily = [largeTitleOptions.fontFamily getWithDefaultValue:nil];
72
+    NSString* fontWeight = [largeTitleOptions.fontWeight getWithDefaultValue:nil];
73
+    NSNumber* fontSize = [largeTitleOptions.fontSize getWithDefaultValue:nil];
74
+    UIColor* fontColor = [largeTitleOptions.color getWithDefaultValue:nil];
75
+    
76
+    _appearance.largeTitleTextAttributes = [RNNFontAttributesCreator createFromDictionary:_appearance.largeTitleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:fontColor defaultColor:nil];
77
+}
78
+
79
+@end

+ 18
- 0
lib/ios/TopBarPresenter.h View File

1
+#import "RNNBasePresenter.h"
2
+#import "RNNTopBarOptions.h"
3
+
4
+@interface TopBarPresenter : RNNBasePresenter
5
+
6
+- (void)applyOptions:(RNNTopBarOptions *)options;
7
+
8
+- (void)applyOptionsBeforePopping:(RNNTopBarOptions *)options;
9
+
10
+- (void)mergeOptions:(RNNTopBarOptions *)options defaultOptions:(RNNTopBarOptions *)defaultOptions;
11
+
12
+- (instancetype)initWithNavigationController:(UINavigationController *)boundNavigationController;
13
+
14
+@property (nonatomic) BOOL transparent;
15
+@property (nonatomic) BOOL translucent;
16
+@property (nonatomic, strong) UIColor* backgroundColor;
17
+
18
+@end

+ 128
- 0
lib/ios/TopBarPresenter.m View File

1
+#import "TopBarPresenter.h"
2
+#import "UIImage+tint.h"
3
+#import "RNNFontAttributesCreator.h"
4
+
5
+@implementation TopBarPresenter
6
+
7
+- (instancetype)initWithNavigationController:(UINavigationController *)boundNavigationController {
8
+    self = [super init];
9
+    self.boundViewController = boundNavigationController;
10
+    return self;
11
+}
12
+
13
+- (void)applyOptions:(RNNTopBarOptions *)options {
14
+    [self setTranslucent:[options.background.translucent getWithDefaultValue:NO]];
15
+    [self setBackgroundColor:[options.background.color getWithDefaultValue:nil]];
16
+    [self setTitleAttributes:options.title];
17
+    [self setLargeTitleAttributes:options.largeTitle];
18
+    [self showBorder:![options.noBorder getWithDefaultValue:NO]];
19
+    [self setBackButtonIcon:[options.backButton.icon getWithDefaultValue:nil] withColor:[options.backButton.color getWithDefaultValue:nil] title:[options.backButton.title getWithDefaultValue:nil] showTitle:[options.backButton.showTitle getWithDefaultValue:YES]];
20
+}
21
+
22
+- (void)applyOptionsBeforePopping:(RNNTopBarOptions *)options {
23
+    [self setBackgroundColor:[options.background.color getWithDefaultValue:nil]];
24
+    [self setTitleAttributes:options.title];
25
+    [self setLargeTitleAttributes:options.largeTitle];
26
+}
27
+
28
+- (void)mergeOptions:(RNNTopBarOptions *)options defaultOptions:(RNNTopBarOptions *)defaultOptions {
29
+    if (options.background.color.hasValue) {
30
+        [self setBackgroundColor:options.background.color.get];
31
+    }
32
+    
33
+    if (options.noBorder.hasValue) {
34
+        [self showBorder:![options.noBorder get]];
35
+    }
36
+    
37
+    if (options.background.translucent.hasValue) {
38
+        [self setTranslucent:[options.background.translucent get]];
39
+    }
40
+    
41
+    RNNLargeTitleOptions* largeTitleOptions = options.largeTitle;
42
+    if (largeTitleOptions.color.hasValue || largeTitleOptions.fontSize.hasValue || largeTitleOptions.fontFamily.hasValue) {
43
+        [self setLargeTitleAttributes:largeTitleOptions];
44
+    }
45
+
46
+    [self setTitleAttributes:options.title];
47
+    
48
+    if (options.backButton.hasValue) {
49
+        [self setBackButtonIcon:[defaultOptions.backButton.icon getWithDefaultValue:nil] withColor:[defaultOptions.backButton.color getWithDefaultValue:nil] title:[defaultOptions.backButton.title getWithDefaultValue:nil] showTitle:[defaultOptions.backButton.showTitle getWithDefaultValue:YES]];
50
+    }
51
+}
52
+
53
+- (UINavigationController *)navigationController {
54
+    return (UINavigationController *)self.boundViewController;
55
+}
56
+
57
+- (void)showBorder:(BOOL)showBorder {
58
+    [self.navigationController.navigationBar setShadowImage:showBorder ? nil : [UIImage new]];
59
+}
60
+
61
+- (void)setBackIndicatorImage:(UIImage *)image withColor:(UIColor *)color {
62
+    [self.navigationController.navigationBar setBackIndicatorImage:image];
63
+    [self.navigationController.navigationBar setBackIndicatorTransitionMaskImage:image];
64
+}
65
+
66
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
67
+    _backgroundColor = backgroundColor;
68
+    [self updateBackgroundAppearance];
69
+}
70
+
71
+- (void)updateBackgroundAppearance {
72
+    if (_transparent) {
73
+        [self setBackgroundColorTransparent];
74
+    } else if (_backgroundColor) {
75
+        self.navigationController.navigationBar.barTintColor = _backgroundColor;
76
+    } else if (_translucent) {
77
+        self.navigationController.navigationBar.translucent = YES;
78
+    } else {
79
+        self.navigationController.navigationBar.translucent = NO;
80
+        self.navigationController.navigationBar.barTintColor = nil;
81
+    }
82
+}
83
+
84
+- (void)setBackgroundColorTransparent {
85
+    self.navigationController.navigationBar.barTintColor = UIColor.clearColor;
86
+    self.navigationController.navigationBar.shadowImage = [UIImage new];
87
+    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
88
+}
89
+
90
+- (void)setTitleAttributes:(RNNTitleOptions *)titleOptions {
91
+    NSString* fontFamily = [titleOptions.fontFamily getWithDefaultValue:nil];
92
+    NSString* fontWeight = [titleOptions.fontWeight getWithDefaultValue:nil];
93
+    NSNumber* fontSize = [titleOptions.fontSize getWithDefaultValue:nil];
94
+    UIColor* fontColor = [titleOptions.color getWithDefaultValue:nil];
95
+    
96
+    self.navigationController.navigationBar.titleTextAttributes = [RNNFontAttributesCreator createFromDictionary:self.navigationController.navigationBar.titleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:fontColor defaultColor:nil];
97
+}
98
+
99
+- (void)setLargeTitleAttributes:(RNNLargeTitleOptions *)largeTitleOptions {
100
+    NSString* fontFamily = [largeTitleOptions.fontFamily getWithDefaultValue:nil];
101
+    NSString* fontWeight = [largeTitleOptions.fontWeight getWithDefaultValue:nil];
102
+    NSNumber* fontSize = [largeTitleOptions.fontSize getWithDefaultValue:nil];
103
+    UIColor* fontColor = [largeTitleOptions.color getWithDefaultValue:nil];
104
+    
105
+    if (@available(iOS 11.0, *)) {
106
+        self.navigationController.navigationBar.largeTitleTextAttributes = [RNNFontAttributesCreator createFromDictionary:self.navigationController.navigationBar.largeTitleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:fontColor defaultColor:nil];
107
+    }
108
+}
109
+
110
+- (void)setBackButtonIcon:(UIImage *)icon withColor:(UIColor *)color title:(NSString *)title showTitle:(BOOL)showTitle {
111
+    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
112
+    NSArray* stackChildren = self.navigationController.viewControllers;
113
+    icon = color
114
+    ? [[icon withTintColor:color] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
115
+    : icon;
116
+    [self setBackIndicatorImage:icon withColor:color];
117
+
118
+    UIViewController *lastViewControllerInStack = stackChildren.count > 1 ? stackChildren[stackChildren.count - 2] : self.navigationController.topViewController;
119
+
120
+    if (showTitle) {
121
+        backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
122
+    }
123
+    backItem.tintColor = color;
124
+
125
+    lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
126
+}
127
+
128
+@end

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

1
+#import <Foundation/Foundation.h>
2
+#import "TopBarPresenter.h"
3
+
4
+@interface TopBarPresenterCreator : NSObject
5
+
6
++ (TopBarPresenter *)createWithBoundedNavigationController:(UINavigationController *)navigationController;
7
+
8
+@end

+ 14
- 0
lib/ios/TopBarPresenterCreator.m View File

1
+#import "TopBarPresenterCreator.h"
2
+#import "TopBarAppearancePresenter.h"
3
+
4
+@implementation TopBarPresenterCreator
5
+
6
++ (TopBarPresenter *)createWithBoundedNavigationController:(UINavigationController *)navigationController {
7
+	if (@available(iOS 13.0, *)) {
8
+		return [[TopBarAppearancePresenter alloc] initWithNavigationController:navigationController];
9
+	} else {
10
+		return [[TopBarPresenter alloc] initWithNavigationController:navigationController];
11
+	}
12
+}
13
+
14
+@end

+ 0
- 15
lib/ios/UINavigationBar+utils.h View File

1
-#import <UIKit/UIKit.h>
2
-
3
-@interface UINavigationBar (utils)
4
-
5
-- (void)rnn_setBackgroundColor:(UIColor *)color;
6
-
7
-- (void)rnn_setBackIndicatorImage:(UIImage *)image;
8
-
9
-- (void)rnn_showBorder:(BOOL)showBorder;
10
-
11
-- (void)rnn_setNavigationBarLargeTitleFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color;
12
-
13
-- (void)rnn_setNavigationBarTitleFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color;
14
-
15
-@end

+ 0
- 130
lib/ios/UINavigationBar+utils.m View File

1
-#import "UINavigationBar+utils.h"
2
-#import "RNNFontAttributesCreator.h"
3
-
4
-@implementation UINavigationBar (utils)
5
-
6
-- (void)rnn_setBackIndicatorImage:(UIImage *)image {
7
-    if (@available(iOS 13.0, *)) {
8
-        [[self getNavigaitonBarStandardAppearance] setBackIndicatorImage:image transitionMaskImage:image];
9
-        [[self getNavigaitonBarCompactAppearance] setBackIndicatorImage:image transitionMaskImage:image];
10
-        [[self getNavigaitonBarScrollEdgeAppearance] setBackIndicatorImage:image transitionMaskImage:image];
11
-    } else {
12
-        [self setBackIndicatorImage:image];
13
-        [self setBackIndicatorTransitionMaskImage:image];
14
-    }
15
-}
16
-
17
-- (void)rnn_setBackgroundColor:(UIColor *)color {
18
-    CGFloat bgColorAlpha = CGColorGetAlpha(color.CGColor);
19
-    
20
-    if (color && bgColorAlpha == 0.0) {
21
-        self.translucent = YES;
22
-        [self setBackgroundColorTransparent];
23
-    } else {
24
-        self.translucent = NO;
25
-        [self setBackgroundColor:color];
26
-    }
27
-}
28
-
29
-- (void)rnn_setNavigationBarLargeTitleFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color {
30
-    NSDictionary* fontAttributes;
31
-    if (@available(iOS 13.0, *)) {
32
-        fontAttributes = [RNNFontAttributesCreator createFromDictionary:self.standardAppearance.largeTitleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:color defaultColor:nil];
33
-        [[self getNavigaitonBarStandardAppearance] setLargeTitleTextAttributes:fontAttributes];
34
-        [[self getNavigaitonBarCompactAppearance] setLargeTitleTextAttributes:fontAttributes];
35
-        [[self getNavigaitonBarScrollEdgeAppearance] setLargeTitleTextAttributes:fontAttributes];
36
-    } else if (@available(iOS 11.0, *)) {
37
-        fontAttributes = [RNNFontAttributesCreator createFromDictionary:self.largeTitleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:color defaultColor:nil];
38
-        self.largeTitleTextAttributes = fontAttributes;
39
-    }
40
-}
41
-
42
-- (void)rnn_setNavigationBarTitleFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color {
43
-    NSDictionary* fontAttributes;
44
-    if (@available(iOS 13.0, *)) {
45
-        fontAttributes = [RNNFontAttributesCreator createFromDictionary:self.standardAppearance.titleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:color defaultColor:nil];
46
-        [[self getNavigaitonBarStandardAppearance] setTitleTextAttributes:fontAttributes];
47
-        [[self getNavigaitonBarCompactAppearance] setTitleTextAttributes:fontAttributes];
48
-        [[self getNavigaitonBarScrollEdgeAppearance] setTitleTextAttributes:fontAttributes];
49
-    } else if (@available(iOS 11.0, *)) {
50
-        fontAttributes = [RNNFontAttributesCreator createFromDictionary:self.titleTextAttributes fontFamily:fontFamily fontSize:fontSize defaultFontSize:nil fontWeight:fontWeight color:color defaultColor:nil];
51
-        self.titleTextAttributes = fontAttributes;
52
-    }
53
-}
54
-
55
-- (void)rnn_showBorder:(BOOL)showBorder {
56
-    if (@available(iOS 13.0, *)) {
57
-        UIColor* shadowColor = showBorder ? [[UINavigationBarAppearance new] shadowColor] : nil;
58
-        [[self getNavigaitonBarStandardAppearance] setShadowColor:shadowColor];
59
-        [[self getNavigaitonBarCompactAppearance] setShadowColor:shadowColor];
60
-        [[self getNavigaitonBarScrollEdgeAppearance] setShadowColor:shadowColor];
61
-    } else {
62
-        [self setShadowImage:showBorder ? nil : [UIImage new]];
63
-    }
64
-}
65
-
66
-- (void)setBackgroundColor:(UIColor *)color {
67
-    if (@available(iOS 13.0, *)) {
68
-        [self getNavigaitonBarStandardAppearance].backgroundColor = color;
69
-        [self getNavigaitonBarCompactAppearance].backgroundColor = color;
70
-        [self getNavigaitonBarScrollEdgeAppearance].backgroundColor = color;
71
-    } else {
72
-        self.barTintColor = color;
73
-    }
74
-}
75
-
76
-- (void)setBackgroundColorTransparent {
77
-    if (@available(iOS 13.0, *)) {
78
-        UIColor* clearColor = [UIColor clearColor];
79
-        [self getNavigaitonBarStandardAppearance].backgroundColor = clearColor;
80
-        [self getNavigaitonBarCompactAppearance].backgroundColor = clearColor;
81
-        [self getNavigaitonBarScrollEdgeAppearance].backgroundColor = clearColor;
82
-        [self getNavigaitonBarStandardAppearance].backgroundEffect = nil;
83
-        [self getNavigaitonBarCompactAppearance].backgroundEffect = nil;
84
-        [self getNavigaitonBarScrollEdgeAppearance].backgroundEffect = nil;
85
-        
86
-    } else {
87
-        self.barTintColor = UIColor.clearColor;
88
-        self.shadowImage = [UIImage new];
89
-        [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
90
-    }
91
-}
92
-
93
-- (void)configureWithTransparentBackground {
94
-    if (@available(iOS 13.0, *)) {
95
-        [[self getNavigaitonBarStandardAppearance] configureWithTransparentBackground];
96
-        [[self getNavigaitonBarCompactAppearance] configureWithTransparentBackground];
97
-        [[self getNavigaitonBarScrollEdgeAppearance] configureWithTransparentBackground];
98
-    }
99
-}
100
-
101
-- (void)configureWithDefaultBackground {
102
-    if (@available(iOS 13.0, *)) {
103
-        [[self getNavigaitonBarStandardAppearance] configureWithDefaultBackground];
104
-        [[self getNavigaitonBarCompactAppearance] configureWithDefaultBackground];
105
-        [[self getNavigaitonBarScrollEdgeAppearance] configureWithDefaultBackground];
106
-    }
107
-}
108
-
109
-- (UINavigationBarAppearance*)getNavigaitonBarStandardAppearance  API_AVAILABLE(ios(13.0)) {
110
-    if (!self.standardAppearance) {
111
-        self.standardAppearance = [UINavigationBarAppearance new];
112
-    }
113
-    return self.standardAppearance;
114
-}
115
-
116
-- (UINavigationBarAppearance*)getNavigaitonBarCompactAppearance  API_AVAILABLE(ios(13.0)) {
117
-    if (!self.compactAppearance) {
118
-        self.compactAppearance = [UINavigationBarAppearance new];
119
-    }
120
-    return self.compactAppearance;
121
-}
122
-
123
-- (UINavigationBarAppearance*)getNavigaitonBarScrollEdgeAppearance  API_AVAILABLE(ios(13.0)) {
124
-    if (!self.scrollEdgeAppearance) {
125
-        self.scrollEdgeAppearance = [UINavigationBarAppearance new];
126
-    }
127
-    return self.scrollEdgeAppearance;
128
-}
129
-
130
-@end

+ 0
- 10
lib/ios/UINavigationController+RNNOptions.h View File

12
 
12
 
13
 - (void)hideBarsOnScroll:(BOOL)hideOnScroll;
13
 - (void)hideBarsOnScroll:(BOOL)hideOnScroll;
14
 
14
 
15
-- (void)setNavigationBarNoBorder:(BOOL)noBorder;
16
-
17
 - (void)setBarStyle:(UIBarStyle)barStyle;
15
 - (void)setBarStyle:(UIBarStyle)barStyle;
18
 
16
 
19
-- (void)setNavigationBarFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color;
20
-
21
-- (void)setNavigationBarTranslucent:(BOOL)translucent;
22
-
23
 - (void)setNavigationBarBlur:(BOOL)blur;
17
 - (void)setNavigationBarBlur:(BOOL)blur;
24
 
18
 
25
 - (void)setNavigationBarClipsToBounds:(BOOL)clipsToBounds;
19
 - (void)setNavigationBarClipsToBounds:(BOOL)clipsToBounds;
26
 
20
 
27
 - (void)setNavigationBarLargeTitleVisible:(BOOL)visible;
21
 - (void)setNavigationBarLargeTitleVisible:(BOOL)visible;
28
 
22
 
29
-- (void)setNavigationBarLargeTitleFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color;
30
-
31
 - (void)setBackButtonColor:(UIColor *)color;
23
 - (void)setBackButtonColor:(UIColor *)color;
32
 
24
 
33
-- (void)setBackButtonIcon:(UIImage *)icon withColor:(UIColor *)color title:(NSString *)title showTitle:(BOOL)showTitle;
34
-
35
 @end
25
 @end

+ 0
- 38
lib/ios/UINavigationController+RNNOptions.m View File

1
 #import "UINavigationController+RNNOptions.h"
1
 #import "UINavigationController+RNNOptions.h"
2
 #import "RNNFontAttributesCreator.h"
2
 #import "RNNFontAttributesCreator.h"
3
-#import "UIImage+tint.h"
4
-#import "UINavigationBar+utils.h"
5
 
3
 
6
 const NSInteger BLUR_TOPBAR_TAG = 78264802;
4
 const NSInteger BLUR_TOPBAR_TAG = 78264802;
7
 
5
 
35
 	self.hidesBarsOnSwipe = hideOnScroll;
33
 	self.hidesBarsOnSwipe = hideOnScroll;
36
 }
34
 }
37
 
35
 
38
-- (void)setNavigationBarNoBorder:(BOOL)noBorder {
39
-	[self.navigationBar rnn_showBorder:!noBorder];
40
-}
41
-
42
 - (void)setBarStyle:(UIBarStyle)barStyle {
36
 - (void)setBarStyle:(UIBarStyle)barStyle {
43
 	self.navigationBar.barStyle = barStyle;
37
 	self.navigationBar.barStyle = barStyle;
44
 }
38
 }
45
 
39
 
46
-- (void)setNavigationBarFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color {
47
-    [self.navigationBar rnn_setNavigationBarTitleFontFamily:fontFamily fontSize:fontSize fontWeight:fontWeight color:color];
48
-}
49
-
50
 - (void)setNavigationBarLargeTitleVisible:(BOOL)visible {
40
 - (void)setNavigationBarLargeTitleVisible:(BOOL)visible {
51
 	if (@available(iOS 11.0, *)) {
41
 	if (@available(iOS 11.0, *)) {
52
 		if (visible){
42
 		if (visible){
57
 	}
47
 	}
58
 }
48
 }
59
 
49
 
60
-- (void)setNavigationBarLargeTitleFontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight color:(UIColor *)color {
61
-    [self.navigationBar rnn_setNavigationBarLargeTitleFontFamily:fontFamily fontSize:fontSize fontWeight:fontWeight color:color];
62
-}
63
-
64
-- (void)setNavigationBarTranslucent:(BOOL)translucent {
65
-	self.navigationBar.translucent = translucent;
66
-}
67
-
68
 - (void)setNavigationBarBlur:(BOOL)blur {
50
 - (void)setNavigationBarBlur:(BOOL)blur {
69
 	if (blur && ![self.navigationBar viewWithTag:BLUR_TOPBAR_TAG]) {
51
 	if (blur && ![self.navigationBar viewWithTag:BLUR_TOPBAR_TAG]) {
70
 		[self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
52
 		[self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
94
 	self.navigationBar.clipsToBounds = clipsToBounds;
76
 	self.navigationBar.clipsToBounds = clipsToBounds;
95
 }
77
 }
96
 
78
 
97
-- (void)setBackButtonIcon:(UIImage *)icon withColor:(UIColor *)color title:(NSString *)title showTitle:(BOOL)showTitle {
98
-    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
99
-    if (icon) {
100
-        icon = color
101
-        ? [[icon withTintColor:color] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
102
-        : icon;
103
-    }
104
-    
105
-    [self.navigationBar rnn_setBackIndicatorImage:icon];
106
-
107
-    UIViewController *lastViewControllerInStack = self.viewControllers.count > 1 ? self.viewControllers[self.viewControllers.count - 2] : self.topViewController;
108
-
109
-    if (showTitle) {
110
-        backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
111
-    }
112
-    backItem.tintColor = color;
113
-
114
-    lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
115
-}
116
-
117
 - (CGFloat)getTopBarHeight {
79
 - (CGFloat)getTopBarHeight {
118
     return self.navigationBar.frame.size.height;
80
     return self.navigationBar.frame.size.height;
119
 }
81
 }

+ 1
- 1
lib/ios/UIViewController+LayoutProtocol.m View File

22
 		[self performSelector:@selector(setViewControllers:) withObject:childViewControllers];
22
 		[self performSelector:@selector(setViewControllers:) withObject:childViewControllers];
23
 	}
23
 	}
24
 	self.presenter = presenter;
24
 	self.presenter = presenter;
25
-    [self.presenter boundViewController:self];
25
+    [self.presenter bindViewController:self];
26
 	[self.presenter applyOptionsOnInit:self.resolveOptions];
26
 	[self.presenter applyOptionsOnInit:self.resolveOptions];
27
 
27
 
28
 	return self;
28
 	return self;

+ 0
- 2
lib/ios/UIViewController+RNNOptions.h View File

34
 
34
 
35
 - (void)setInterceptTouchOutside:(BOOL)interceptTouchOutside;
35
 - (void)setInterceptTouchOutside:(BOOL)interceptTouchOutside;
36
 
36
 
37
-- (void)applyBackButton:(RNNBackButtonOptions *)backButton;
38
-
39
 - (BOOL)isModal;
37
 - (BOOL)isModal;
40
 
38
 
41
 @end
39
 @end

+ 0
- 19
lib/ios/UIViewController+RNNOptions.m View File

1
 #import "UIViewController+RNNOptions.h"
1
 #import "UIViewController+RNNOptions.h"
2
 #import <React/RCTRootView.h>
2
 #import <React/RCTRootView.h>
3
-#import "UIImage+tint.h"
4
-#import "UINavigationBar+utils.h"
5
 #import "RNNBottomTabOptions.h"
3
 #import "RNNBottomTabOptions.h"
6
 #import "RNNNavigationOptions.h"
4
 #import "RNNNavigationOptions.h"
7
 #import "RNNBackButtonOptions.h"
5
 #import "RNNBackButtonOptions.h"
161
 	}
159
 	}
162
 }
160
 }
163
 
161
 
164
-- (void)applyBackButton:(RNNBackButtonOptions *)backButton {
165
-	UIBarButtonItem *backItem = [UIBarButtonItem new];
166
-	if (backButton.icon.hasValue) {
167
-		UIColor *color = [backButton.color getWithDefaultValue:nil];
168
-		backItem.image = color ?
169
-				[[backButton.icon.get withTintColor:color] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] :
170
-				backButton.icon.get;
171
-
172
-		[self.navigationController.navigationBar setBackIndicatorImage:[UIImage new]];
173
-        [self.navigationController.navigationBar setBackIndicatorTransitionMaskImage:[UIImage new]];
174
-	}
175
-
176
-	if ([backButton.showTitle getWithDefaultValue:YES]) backItem.title = [backButton.title getWithDefaultValue:nil];
177
-	if (backButton.color.hasValue) backItem.tintColor = [backButton.color get];
178
-	self.navigationItem.backBarButtonItem = backItem;
179
-}
180
-
181
 @end
162
 @end

+ 3
- 3
playground/ios/NavigationTests/RNNBasePresenterTest.m View File

20
     self.uut = [[RNNBasePresenter alloc] init];
20
     self.uut = [[RNNBasePresenter alloc] init];
21
     self.boundViewController = [RNNComponentViewController new];
21
     self.boundViewController = [RNNComponentViewController new];
22
     self.mockBoundViewController = [OCMockObject partialMockForObject:self.boundViewController];
22
     self.mockBoundViewController = [OCMockObject partialMockForObject:self.boundViewController];
23
-    [self.uut boundViewController:self.mockBoundViewController];
23
+	[self.uut bindViewController:self.mockBoundViewController];
24
     self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
24
     self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
25
 }
25
 }
26
 
26
 
45
 }
45
 }
46
 
46
 
47
 - (void)testApplyOptions_setTabBarItemBadgeShouldNotCalledOnUITabBarController {
47
 - (void)testApplyOptions_setTabBarItemBadgeShouldNotCalledOnUITabBarController {
48
-    [self.uut boundViewController:self.mockBoundViewController];
48
+    [self.uut bindViewController:self.mockBoundViewController];
49
     self.options.bottomTab.badge = [[Text alloc] initWithValue:@"badge"];
49
     self.options.bottomTab.badge = [[Text alloc] initWithValue:@"badge"];
50
     [[self.mockBoundViewController reject] setTabBarItemBadge:[[RNNBottomTabOptions alloc] initWithDict:@{@"badge": @"badge"}]];
50
     [[self.mockBoundViewController reject] setTabBarItemBadge:[[RNNBottomTabOptions alloc] initWithDict:@{@"badge": @"badge"}]];
51
     [self.uut applyOptions:self.options];
51
     [self.uut applyOptions:self.options];
53
 }
53
 }
54
 
54
 
55
 - (void)testApplyOptions_setTabBarItemBadgeShouldWhenNoValue {
55
 - (void)testApplyOptions_setTabBarItemBadgeShouldWhenNoValue {
56
-    [self.uut boundViewController:self.mockBoundViewController];
56
+    [self.uut bindViewController:self.mockBoundViewController];
57
     self.options.bottomTab.badge = nil;
57
     self.options.bottomTab.badge = nil;
58
     [[self.mockBoundViewController reject] setTabBarItemBadge:[OCMArg any]];
58
     [[self.mockBoundViewController reject] setTabBarItemBadge:[OCMArg any]];
59
     [self.uut applyOptions:self.options];
59
     [self.uut applyOptions:self.options];

+ 6
- 6
playground/ios/NavigationTests/RNNComponentPresenterTest.m View File

23
 	self.componentRegistry = [OCMockObject partialMockForObject:[RNNReactComponentRegistry new]];
23
 	self.componentRegistry = [OCMockObject partialMockForObject:[RNNReactComponentRegistry new]];
24
 	self.uut = [[RNNComponentPresenter alloc] initWithComponentRegistry:self.componentRegistry:[[RNNNavigationOptions alloc] initEmptyOptions]];
24
 	self.uut = [[RNNComponentPresenter alloc] initWithComponentRegistry:self.componentRegistry:[[RNNNavigationOptions alloc] initEmptyOptions]];
25
 	self.boundViewController = [OCMockObject partialMockForObject:[RNNComponentViewController new]];
25
 	self.boundViewController = [OCMockObject partialMockForObject:[RNNComponentViewController new]];
26
-	[self.uut boundViewController:self.boundViewController];
26
+	[self.uut bindViewController:self.boundViewController];
27
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
27
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
28
 }
28
 }
29
 
29
 
74
 
74
 
75
 - (void)testBindViewControllerShouldCreateNavigationButtonsCreator {
75
 - (void)testBindViewControllerShouldCreateNavigationButtonsCreator {
76
 	RNNComponentPresenter* presenter = [[RNNComponentPresenter alloc] init];
76
 	RNNComponentPresenter* presenter = [[RNNComponentPresenter alloc] init];
77
-	[presenter boundViewController:self.boundViewController];
77
+	[presenter bindViewController:self.boundViewController];
78
 	XCTAssertNotNil(presenter.navigationButtons);
78
 	XCTAssertNotNil(presenter.navigationButtons);
79
 }
79
 }
80
 
80
 
139
 - (void)testReactViewShouldBeReleasedOnDealloc {
139
 - (void)testReactViewShouldBeReleasedOnDealloc {
140
 	RNNComponentViewController* bindViewController = [RNNComponentViewController new];
140
 	RNNComponentViewController* bindViewController = [RNNComponentViewController new];
141
 	bindViewController.layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
141
 	bindViewController.layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
142
-	[self.uut boundViewController:bindViewController];
142
+	[self.uut bindViewController:bindViewController];
143
 	
143
 	
144
 	self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"componentName"}];
144
 	self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"componentName"}];
145
 	
145
 	
154
 	layoutInfo.componentId = @"componentId";
154
 	layoutInfo.componentId = @"componentId";
155
 	bindViewController.layoutInfo = layoutInfo;
155
 	bindViewController.layoutInfo = layoutInfo;
156
 
156
 
157
-	[self.uut boundViewController:bindViewController];
157
+	[self.uut bindViewController:bindViewController];
158
 	XCTAssertEqual(self.uut.boundComponentId, @"componentId");
158
 	XCTAssertEqual(self.uut.boundComponentId, @"componentId");
159
 }
159
 }
160
 
160
 
163
 	RNNLayoutInfo* layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
163
 	RNNLayoutInfo* layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
164
 	boundViewController.layoutInfo = layoutInfo;
164
 	boundViewController.layoutInfo = layoutInfo;
165
 	boundViewController.defaultOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
165
 	boundViewController.defaultOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
166
-	[self.uut boundViewController:boundViewController];
166
+	[self.uut bindViewController:boundViewController];
167
 	
167
 	
168
 	self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent", @"componentId": @"id"}];
168
 	self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent", @"componentId": @"id"}];
169
 	
169
 	
182
 	RNNComponentViewController* boundViewController = [RNNComponentViewController new];
182
 	RNNComponentViewController* boundViewController = [RNNComponentViewController new];
183
 	boundViewController.layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
183
 	boundViewController.layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
184
 	self.uut.defaultOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
184
 	self.uut.defaultOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
185
-	[self.uut boundViewController:boundViewController];
185
+	[self.uut bindViewController:boundViewController];
186
 	
186
 	
187
 	self.uut.defaultOptions.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent", @"componentId": @"id"}];
187
 	self.uut.defaultOptions.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent", @"componentId": @"id"}];
188
 	
188
 	

+ 0
- 32
playground/ios/NavigationTests/RNNNavigationControllerTest.m View File

152
 	[(id)self.uut.options verify];
152
 	[(id)self.uut.options verify];
153
 }
153
 }
154
 
154
 
155
-- (void)testSetTopBarBackgroundColor_ShouldSetBackgroundColor {
156
-	UIColor* color = UIColor.redColor;
157
-	[self.uut setTopBarBackgroundColor:color];
158
-	XCTAssertEqual(self.uut.navigationBar.standardAppearance.backgroundColor, color);
159
-	XCTAssertEqual(self.uut.navigationBar.compactAppearance.backgroundColor, color);
160
-	XCTAssertEqual(self.uut.navigationBar.scrollEdgeAppearance.backgroundColor, color);
161
-}
162
-
163
-- (void)testSetTopBarBackgroundColor_ShouldSetTransparentBackgroundColor {
164
-	UIColor* transparentColor = UIColor.clearColor;
165
-	[self.uut setTopBarBackgroundColor:transparentColor];
166
-
167
-	XCTAssertTrue(self.uut.navigationBar.translucent);
168
-	XCTAssertNil(self.uut.navigationBar.standardAppearance.backgroundColor);
169
-	XCTAssertNil(self.uut.navigationBar.compactAppearance.backgroundColor);
170
-	XCTAssertNil(self.uut.navigationBar.scrollEdgeAppearance.backgroundColor);
171
-}
172
-
173
-- (void)testSetTopBarBackgroundColor_NilColorShouldResetNavigationBar {
174
-	UIColor* transparentColor = UIColor.clearColor;
175
-	UIColor* redColor = UIColor.redColor;
176
-	
177
-	[self.uut setTopBarBackgroundColor:transparentColor];
178
-	[self.uut setTopBarBackgroundColor:redColor];
179
-	[self.uut setTopBarBackgroundColor:nil];
180
-	
181
-	XCTAssertNil(self.uut.navigationBar.barTintColor);
182
-	XCTAssertNil(self.uut.navigationBar.standardAppearance.backgroundColor);
183
-	XCTAssertNil(self.uut.navigationBar.compactAppearance.backgroundColor);
184
-	XCTAssertNil(self.uut.navigationBar.scrollEdgeAppearance.backgroundColor);
185
-}
186
-
187
 - (RNNStackController *)createNavigationControllerWithOptions:(RNNNavigationOptions *)options {
155
 - (RNNStackController *)createNavigationControllerWithOptions:(RNNNavigationOptions *)options {
188
 	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:options defaultOptions:nil presenter:[[RNNStackPresenter alloc] init] eventEmitter:nil childViewControllers:@[_vc1]];
156
 	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:options defaultOptions:nil presenter:[[RNNStackPresenter alloc] init] eventEmitter:nil childViewControllers:@[_vc1]];
189
 	return nav;
157
 	return nav;

+ 52
- 44
playground/ios/NavigationTests/RNNRootViewControllerTest.m View File

53
 	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:layoutInfo rootViewCreator:self.creator eventEmitter:self.emitter presenter:presenter options:self.options defaultOptions:nil];
53
 	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:layoutInfo rootViewCreator:self.creator eventEmitter:self.emitter presenter:presenter options:self.options defaultOptions:nil];
54
 }
54
 }
55
 
55
 
56
--(void)testTopBarBackgroundColor_validColor{
56
+- (void)testTopBarBackgroundColor_validColor {
57
 	NSNumber* inputColor = @(0xFFFF0000);
57
 	NSNumber* inputColor = @(0xFFFF0000);
58
 	self.options.topBar.background.color = [[Color alloc] initWithValue:[RCTConvert UIColor:inputColor]];
58
 	self.options.topBar.background.color = [[Color alloc] initWithValue:[RCTConvert UIColor:inputColor]];
59
 	__unused RNNStackController* nav = [self createNavigationController];
59
 	__unused RNNStackController* nav = [self createNavigationController];
63
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.backgroundColor isEqual:expectedColor]);
63
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.backgroundColor isEqual:expectedColor]);
64
 }
64
 }
65
 
65
 
66
--(void)testTopBarBackgroundColorWithoutNavigationController{
66
+- (void)testTopBarBackgroundColorWithoutNavigationController {
67
 	NSNumber* inputColor = @(0xFFFF0000);
67
 	NSNumber* inputColor = @(0xFFFF0000);
68
 	self.options.topBar.background.color = [[Color alloc] initWithValue:[RCTConvert UIColor:inputColor]];
68
 	self.options.topBar.background.color = [[Color alloc] initWithValue:[RCTConvert UIColor:inputColor]];
69
 
69
 
108
 	XCTAssertTrue([self.uut prefersStatusBarHidden]);
108
 	XCTAssertTrue([self.uut prefersStatusBarHidden]);
109
 }
109
 }
110
 
110
 
111
--(void)testTitle_string{
111
+- (void)testTitle_string{
112
 	NSString* title =@"some title";
112
 	NSString* title =@"some title";
113
 	self.options.topBar.title.text = [[Text alloc] initWithValue:title];
113
 	self.options.topBar.title.text = [[Text alloc] initWithValue:title];
114
 
114
 
116
 	XCTAssertTrue([self.uut.navigationItem.title isEqual:title]);
116
 	XCTAssertTrue([self.uut.navigationItem.title isEqual:title]);
117
 }
117
 }
118
 
118
 
119
--(void)testTitle_default{
119
+- (void)testTitle_default{
120
 	[self.uut viewWillAppear:false];
120
 	[self.uut viewWillAppear:false];
121
 	XCTAssertNil(self.uut.navigationItem.title);
121
 	XCTAssertNil(self.uut.navigationItem.title);
122
 }
122
 }
123
 
123
 
124
--(void)testTopBarTextColor_validColor{
124
+- (void)testTopBarTextColor_validColor{
125
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
125
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
126
 	self.options.topBar.title.color = [[Color alloc] initWithValue:inputColor];
126
 	self.options.topBar.title.color = [[Color alloc] initWithValue:inputColor];
127
 	__unused RNNStackController* nav = [self createNavigationController];
127
 	__unused RNNStackController* nav = [self createNavigationController];
130
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
130
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
131
 }
131
 }
132
 
132
 
133
--(void)testbackgroundColor_validColor{
133
+- (void)testbackgroundColor_validColor{
134
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
134
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
135
 	self.options.layout.backgroundColor = [[Color alloc] initWithValue:inputColor];
135
 	self.options.layout.backgroundColor = [[Color alloc] initWithValue:inputColor];
136
 	[self.uut viewWillAppear:false];
136
 	[self.uut viewWillAppear:false];
138
 	XCTAssertTrue([self.uut.view.backgroundColor isEqual:expectedColor]);
138
 	XCTAssertTrue([self.uut.view.backgroundColor isEqual:expectedColor]);
139
 }
139
 }
140
 
140
 
141
--(void)testTopBarTextFontFamily_validFont{
141
+- (void)testTopBarTextFontFamily_validFont{
142
 	NSString* inputFont = @"HelveticaNeue";
142
 	NSString* inputFont = @"HelveticaNeue";
143
 	__unused RNNStackController* nav = [self createNavigationController];
143
 	__unused RNNStackController* nav = [self createNavigationController];
144
 	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
144
 	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
147
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
147
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
148
 }
148
 }
149
 
149
 
150
--(void)testTopBarHideOnScroll_true {
150
+- (void)testTopBarHideOnScroll_true {
151
 	NSNumber* hideOnScrollInput = @(1);
151
 	NSNumber* hideOnScrollInput = @(1);
152
 	__unused RNNStackController* nav = [self createNavigationController];
152
 	__unused RNNStackController* nav = [self createNavigationController];
153
 	self.options.topBar.hideOnScroll = [[Bool alloc] initWithValue:hideOnScrollInput];;
153
 	self.options.topBar.hideOnScroll = [[Bool alloc] initWithValue:hideOnScrollInput];;
155
 	XCTAssertTrue(self.uut.navigationController.hidesBarsOnSwipe);
155
 	XCTAssertTrue(self.uut.navigationController.hidesBarsOnSwipe);
156
 }
156
 }
157
 
157
 
158
--(void)testTopBarTranslucent {
158
+- (void)testTopBarTranslucent {
159
 	NSNumber* topBarTranslucentInput = @(0);
159
 	NSNumber* topBarTranslucentInput = @(0);
160
 	self.options.topBar.background.translucent = [[Bool alloc] initWithValue:topBarTranslucentInput];
160
 	self.options.topBar.background.translucent = [[Bool alloc] initWithValue:topBarTranslucentInput];
161
 	__unused RNNStackController* nav = [self createNavigationController];
161
 	__unused RNNStackController* nav = [self createNavigationController];
162
 	[self.uut viewWillAppear:false];
162
 	[self.uut viewWillAppear:false];
163
-	XCTAssertFalse(self.uut.navigationController.navigationBar.translucent);
163
+	XCTAssertTrue(CGColorEqualToColor(self.uut.navigationController.navigationBar.standardAppearance.shadowColor.CGColor, [UINavigationBarAppearance new].shadowColor.CGColor));
164
+	XCTAssertTrue(CGColorEqualToColor(self.uut.navigationController.navigationBar.standardAppearance.backgroundColor.CGColor, UIColor.systemBackgroundColor.CGColor));
164
 }
165
 }
165
 
166
 
166
--(void)testTabBadge {
167
+- (void)testTopBarTransparent {
168
+	self.options.topBar.background.color = [[Color alloc] initWithValue:UIColor.clearColor];
169
+	__unused RNNStackController* nav = [self createNavigationController];
170
+	[self.uut viewWillAppear:false];
171
+	XCTAssertNil(self.uut.navigationController.navigationBar.standardAppearance.backgroundColor);
172
+}
173
+
174
+- (void)testTabBadge {
167
 	NSString* tabBadgeInput = @"5";
175
 	NSString* tabBadgeInput = @"5";
168
 	self.options.bottomTab.badge = [[Text alloc] initWithValue:tabBadgeInput];
176
 	self.options.bottomTab.badge = [[Text alloc] initWithValue:tabBadgeInput];
169
 	__unused RNNBottomTabsController* vc = [[RNNBottomTabsController alloc] init];
177
 	__unused RNNBottomTabsController* vc = [[RNNBottomTabsController alloc] init];
177
 
185
 
178
 }
186
 }
179
 
187
 
180
--(void)testTopBarLargeTitle_default {
188
+- (void)testTopBarLargeTitle_default {
181
 	[self.uut viewWillAppear:false];
189
 	[self.uut viewWillAppear:false];
182
 
190
 
183
 	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode,  UINavigationItemLargeTitleDisplayModeNever);
191
 	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode,  UINavigationItemLargeTitleDisplayModeNever);
184
 }
192
 }
185
 
193
 
186
--(void)testTopBarLargeTitle_true {
194
+- (void)testTopBarLargeTitle_true {
187
 	self.options.topBar.largeTitle.visible = [[Bool alloc] initWithValue:@(1)];
195
 	self.options.topBar.largeTitle.visible = [[Bool alloc] initWithValue:@(1)];
188
 	[self.uut viewWillAppear:false];
196
 	[self.uut viewWillAppear:false];
189
 	
197
 	
190
 	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
198
 	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
191
 }
199
 }
192
 
200
 
193
--(void)testTopBarLargeTitle_false {
201
+- (void)testTopBarLargeTitle_false {
194
 	self.options.topBar.largeTitle.visible = [[Bool alloc] initWithValue:@(0)];
202
 	self.options.topBar.largeTitle.visible = [[Bool alloc] initWithValue:@(0)];
195
 	[self.uut viewWillAppear:false];
203
 	[self.uut viewWillAppear:false];
196
 	
204
 	
198
 }
206
 }
199
 
207
 
200
 
208
 
201
--(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withoutTextColor {
209
+- (void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withoutTextColor {
202
 	NSNumber* topBarTextFontSizeInput = @(15);
210
 	NSNumber* topBarTextFontSizeInput = @(15);
203
 	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
211
 	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
204
 	__unused RNNStackController* nav = [self createNavigationController];
212
 	__unused RNNStackController* nav = [self createNavigationController];
208
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
216
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
209
 }
217
 }
210
 
218
 
211
--(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withTextColor {
219
+- (void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withTextColor {
212
 	NSNumber* topBarTextFontSizeInput = @(15);
220
 	NSNumber* topBarTextFontSizeInput = @(15);
213
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
221
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
214
 	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
222
 	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
222
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
230
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
223
 }
231
 }
224
 
232
 
225
--(void)testTopBarLargeTitleFontSize_withTextFontFamily_withTextColor {
233
+- (void)testTopBarLargeTitleFontSize_withTextFontFamily_withTextColor {
226
 	NSNumber* topBarTextFontSizeInput = @(15);
234
 	NSNumber* topBarTextFontSizeInput = @(15);
227
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
235
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
228
 	NSString* inputFont = @"HelveticaNeue";
236
 	NSString* inputFont = @"HelveticaNeue";
238
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
246
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
239
 }
247
 }
240
 
248
 
241
--(void)testTopBarLargeTitleFontSize_withTextFontFamily_withoutTextColor {
249
+- (void)testTopBarLargeTitleFontSize_withTextFontFamily_withoutTextColor {
242
 	NSNumber* topBarTextFontSizeInput = @(15);
250
 	NSNumber* topBarTextFontSizeInput = @(15);
243
 	NSString* inputFont = @"HelveticaNeue";
251
 	NSString* inputFont = @"HelveticaNeue";
244
 	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
252
 	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
250
 }
258
 }
251
 
259
 
252
 
260
 
253
--(void)testTopBarTextFontSize_withoutTextFontFamily_withoutTextColor {
261
+- (void)testTopBarTextFontSize_withoutTextFontFamily_withoutTextColor {
254
 	NSNumber* topBarTextFontSizeInput = @(15);
262
 	NSNumber* topBarTextFontSizeInput = @(15);
255
 	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
263
 	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
256
 	__unused RNNStackController* nav = [self createNavigationController];
264
 	__unused RNNStackController* nav = [self createNavigationController];
260
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
268
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
261
 }
269
 }
262
 
270
 
263
--(void)testTopBarTextFontSize_withoutTextFontFamily_withTextColor {
271
+- (void)testTopBarTextFontSize_withoutTextFontFamily_withTextColor {
264
 	NSNumber* topBarTextFontSizeInput = @(15);
272
 	NSNumber* topBarTextFontSizeInput = @(15);
265
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
273
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
266
 	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
274
 	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
274
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
282
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
275
 }
283
 }
276
 
284
 
277
--(void)testTopBarTextFontSize_withTextFontFamily_withTextColor {
285
+- (void)testTopBarTextFontSize_withTextFontFamily_withTextColor {
278
 	NSNumber* topBarTextFontSizeInput = @(15);
286
 	NSNumber* topBarTextFontSizeInput = @(15);
279
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
287
 	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
280
 	NSString* inputFont = @"HelveticaNeue";
288
 	NSString* inputFont = @"HelveticaNeue";
289
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
297
 	XCTAssertTrue([self.uut.navigationController.navigationBar.standardAppearance.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
290
 }
298
 }
291
 
299
 
292
--(void)testTopBarTextFontSize_withTextFontFamily_withoutTextColor {
300
+- (void)testTopBarTextFontSize_withTextFontFamily_withoutTextColor {
293
 	NSNumber* topBarTextFontSizeInput = @(15);
301
 	NSNumber* topBarTextFontSizeInput = @(15);
294
 	NSString* inputFont = @"HelveticaNeue";
302
 	NSString* inputFont = @"HelveticaNeue";
295
 	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
303
 	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
301
 }
309
 }
302
 
310
 
303
 // TODO: Currently not passing
311
 // TODO: Currently not passing
304
--(void)testTopBarTextFontFamily_invalidFont{
312
+- (void)testTopBarTextFontFamily_invalidFont{
305
 	NSString* inputFont = @"HelveticaNeueeeee";
313
 	NSString* inputFont = @"HelveticaNeueeeee";
306
 	__unused RNNStackController* nav = [self createNavigationController];
314
 	__unused RNNStackController* nav = [self createNavigationController];
307
 	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
315
 	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
308
 	//	XCTAssertThrows([self.uut viewWillAppear:false]);
316
 	//	XCTAssertThrows([self.uut viewWillAppear:false]);
309
 }
317
 }
310
 
318
 
311
--(void)testOrientation_portrait {
319
+- (void)testOrientation_portrait {
312
 	NSArray* supportedOrientations = @[@"portrait"];
320
 	NSArray* supportedOrientations = @[@"portrait"];
313
 	self.options.layout.orientation = supportedOrientations;
321
 	self.options.layout.orientation = supportedOrientations;
314
 	__unused RNNStackController* nav = [self createNavigationController];
322
 	__unused RNNStackController* nav = [self createNavigationController];
317
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
325
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
318
 }
326
 }
319
 
327
 
320
--(void)testOrientation_portraitString {
328
+- (void)testOrientation_portraitString {
321
 	NSString* supportedOrientation = @"portrait";
329
 	NSString* supportedOrientation = @"portrait";
322
 	self.options.layout.orientation = supportedOrientation;
330
 	self.options.layout.orientation = supportedOrientation;
323
 	__unused RNNStackController* nav = [self createNavigationController];
331
 	__unused RNNStackController* nav = [self createNavigationController];
326
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
334
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
327
 }
335
 }
328
 
336
 
329
--(void)testOrientation_portraitAndLandscape {
337
+- (void)testOrientation_portraitAndLandscape {
330
 	NSArray* supportedOrientations = @[@"portrait", @"landscape"];
338
 	NSArray* supportedOrientations = @[@"portrait", @"landscape"];
331
 	self.options.layout.orientation = supportedOrientations;
339
 	self.options.layout.orientation = supportedOrientations;
332
 	__unused RNNStackController* nav = [self createNavigationController];
340
 	__unused RNNStackController* nav = [self createNavigationController];
335
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
343
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
336
 }
344
 }
337
 
345
 
338
--(void)testOrientation_all {
346
+- (void)testOrientation_all {
339
 	NSArray* supportedOrientations = @[@"all"];
347
 	NSArray* supportedOrientations = @[@"all"];
340
 	self.options.layout.orientation = supportedOrientations;
348
 	self.options.layout.orientation = supportedOrientations;
341
 	__unused RNNStackController* nav = [self createNavigationController];
349
 	__unused RNNStackController* nav = [self createNavigationController];
344
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
352
 	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
345
 }
353
 }
346
 
354
 
347
--(void)testOrientation_default {
355
+- (void)testOrientation_default {
348
 	NSString* supportedOrientations = @"default";
356
 	NSString* supportedOrientations = @"default";
349
 	self.options.layout.orientation = supportedOrientations;
357
 	self.options.layout.orientation = supportedOrientations;
350
 	__unused RNNStackController* nav = [self createNavigationController];
358
 	__unused RNNStackController* nav = [self createNavigationController];
354
 }
362
 }
355
 
363
 
356
 
364
 
357
--(void)testOrientationTabsController_portrait {
365
+- (void)testOrientationTabsController_portrait {
358
 	NSArray* supportedOrientations = @[@"portrait"];
366
 	NSArray* supportedOrientations = @[@"portrait"];
359
 	self.options.layout.orientation = supportedOrientations;
367
 	self.options.layout.orientation = supportedOrientations;
360
 	NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
368
 	NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
366
 	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
374
 	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
367
 }
375
 }
368
 
376
 
369
--(void)testOrientationTabsController_portraitAndLandscape {
377
+- (void)testOrientationTabsController_portraitAndLandscape {
370
 	NSArray* supportedOrientations = @[@"portrait", @"landscape"];
378
 	NSArray* supportedOrientations = @[@"portrait", @"landscape"];
371
 	self.options.layout.orientation = supportedOrientations;
379
 	self.options.layout.orientation = supportedOrientations;
372
     NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
380
     NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
378
 	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
386
 	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
379
 }
387
 }
380
 
388
 
381
--(void)testOrientationTabsController_all {
389
+- (void)testOrientationTabsController_all {
382
 	NSArray* supportedOrientations = @[@"all"];
390
 	NSArray* supportedOrientations = @[@"all"];
383
 	self.options.layout.orientation = supportedOrientations;
391
 	self.options.layout.orientation = supportedOrientations;
384
 	NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
392
 	NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
390
 	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
398
 	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
391
 }
399
 }
392
 
400
 
393
--(void)testRightButtonsWithTitle_withoutStyle {
401
+- (void)testRightButtonsWithTitle_withoutStyle {
394
 	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"text": @"test"}];
402
 	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"text": @"test"}];
395
 	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
403
 	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
396
 	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
404
 	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
403
 	XCTAssertTrue(button.enabled);
411
 	XCTAssertTrue(button.enabled);
404
 }
412
 }
405
 
413
 
406
--(void)testRightButtonsWithTitle_withStyle {
414
+- (void)testRightButtonsWithTitle_withStyle {
407
 	NSNumber* inputColor = @(0xFFFF0000);
415
 	NSNumber* inputColor = @(0xFFFF0000);
408
 
416
 
409
 	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"text": @"test", @"enabled": @false, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
417
 	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"text": @"test", @"enabled": @false, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
420
 	//TODO: Determine how to tests buttonColor,buttonFontSize and buttonFontWeight?
428
 	//TODO: Determine how to tests buttonColor,buttonFontSize and buttonFontWeight?
421
 }
429
 }
422
 
430
 
423
--(void)testLeftButtonsWithTitle_withoutStyle {
431
+- (void)testLeftButtonsWithTitle_withoutStyle {
424
 	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"text": @"test"}];
432
 	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"text": @"test"}];
425
 	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
433
 	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
426
 	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
434
 	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
433
 	XCTAssertTrue(button.enabled);
441
 	XCTAssertTrue(button.enabled);
434
 }
442
 }
435
 
443
 
436
--(void)testLeftButtonsWithTitle_withStyle {
444
+- (void)testLeftButtonsWithTitle_withStyle {
437
 	NSNumber* inputColor = @(0xFFFF0000);
445
 	NSNumber* inputColor = @(0xFFFF0000);
438
 
446
 
439
 	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"text": @"test", @"enabled": @false, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
447
 	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"text": @"test", @"enabled": @false, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
450
 	//TODO: Determine how to tests buttonColor,buttonFontSize and buttonFontWeight?
458
 	//TODO: Determine how to tests buttonColor,buttonFontSize and buttonFontWeight?
451
 }
459
 }
452
 
460
 
453
--(void)testTopBarNoBorderOn {
461
+- (void)testTopBarNoBorderOn {
454
 	NSNumber* topBarNoBorderInput = @(1);
462
 	NSNumber* topBarNoBorderInput = @(1);
455
 	self.options.topBar.noBorder = [[Bool alloc] initWithValue:topBarNoBorderInput];
463
 	self.options.topBar.noBorder = [[Bool alloc] initWithValue:topBarNoBorderInput];
456
 	__unused RNNStackController* nav = [self createNavigationController];
464
 	__unused RNNStackController* nav = [self createNavigationController];
458
 	XCTAssertNil(self.uut.navigationController.navigationBar.standardAppearance.shadowColor);
466
 	XCTAssertNil(self.uut.navigationController.navigationBar.standardAppearance.shadowColor);
459
 }
467
 }
460
 
468
 
461
--(void)testTopBarNoBorderOff {
469
+- (void)testTopBarNoBorderOff {
462
 	NSNumber* topBarNoBorderInput = @(0);
470
 	NSNumber* topBarNoBorderInput = @(0);
463
 	self.options.topBar.noBorder = [[Bool alloc] initWithValue:topBarNoBorderInput];
471
 	self.options.topBar.noBorder = [[Bool alloc] initWithValue:topBarNoBorderInput];
464
 	__unused RNNStackController* nav = [self createNavigationController];
472
 	__unused RNNStackController* nav = [self createNavigationController];
465
 	[self.uut viewWillAppear:false];
473
 	[self.uut viewWillAppear:false];
466
-	XCTAssertEqual(self.uut.navigationController.navigationBar.standardAppearance.shadowColor, [UINavigationBarAppearance new].shadowColor);
474
+	XCTAssertTrue(CGColorEqualToColor(self.uut.navigationController.navigationBar.standardAppearance.shadowColor.CGColor, [UINavigationBarAppearance new].shadowColor.CGColor));
467
 }
475
 }
468
 
476
 
469
--(void)testStatusBarBlurOn {
477
+- (void)testStatusBarBlurOn {
470
 	NSNumber* statusBarBlurInput = @(1);
478
 	NSNumber* statusBarBlurInput = @(1);
471
 	self.options.statusBar.blur = [[Bool alloc] initWithValue:statusBarBlurInput];
479
 	self.options.statusBar.blur = [[Bool alloc] initWithValue:statusBarBlurInput];
472
 	[self.uut viewWillAppear:false];
480
 	[self.uut viewWillAppear:false];
473
 	XCTAssertNotNil([self.uut.view viewWithTag:BLUR_STATUS_TAG]);
481
 	XCTAssertNotNil([self.uut.view viewWithTag:BLUR_STATUS_TAG]);
474
 }
482
 }
475
 
483
 
476
--(void)testStatusBarBlurOff {
484
+- (void)testStatusBarBlurOff {
477
 	NSNumber* statusBarBlurInput = @(0);
485
 	NSNumber* statusBarBlurInput = @(0);
478
 	self.options.statusBar.blur = [[Bool alloc] initWithValue:statusBarBlurInput];
486
 	self.options.statusBar.blur = [[Bool alloc] initWithValue:statusBarBlurInput];
479
 	[self.uut viewWillAppear:false];
487
 	[self.uut viewWillAppear:false];
493
 	XCTAssertFalse([self.uut hidesBottomBarWhenPushed]);
501
 	XCTAssertFalse([self.uut hidesBottomBarWhenPushed]);
494
 }
502
 }
495
 
503
 
496
--(void)testTopBarBlur_default {
504
+- (void)testTopBarBlur_default {
497
 	__unused RNNStackController* nav = [self createNavigationController];
505
 	__unused RNNStackController* nav = [self createNavigationController];
498
 	[self.uut viewWillAppear:false];
506
 	[self.uut viewWillAppear:false];
499
 	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
507
 	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
500
 }
508
 }
501
 
509
 
502
--(void)testTopBarBlur_false {
510
+- (void)testTopBarBlur_false {
503
 	NSNumber* topBarBlurInput = @(0);
511
 	NSNumber* topBarBlurInput = @(0);
504
 	self.options.topBar.background.blur = [[Bool alloc] initWithValue:topBarBlurInput];
512
 	self.options.topBar.background.blur = [[Bool alloc] initWithValue:topBarBlurInput];
505
 	__unused RNNStackController* nav = [self createNavigationController];
513
 	__unused RNNStackController* nav = [self createNavigationController];
507
 	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
515
 	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
508
 }
516
 }
509
 
517
 
510
--(void)testTopBarBlur_true {
518
+- (void)testTopBarBlur_true {
511
 	NSNumber* topBarBlurInput = @(1);
519
 	NSNumber* topBarBlurInput = @(1);
512
 	self.options.topBar.background.blur = [[Bool alloc] initWithValue:topBarBlurInput];
520
 	self.options.topBar.background.blur = [[Bool alloc] initWithValue:topBarBlurInput];
513
 	__unused RNNStackController* nav = [self createNavigationController];
521
 	__unused RNNStackController* nav = [self createNavigationController];
515
 	XCTAssertNotNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
523
 	XCTAssertNotNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
516
 }
524
 }
517
 
525
 
518
--(void)testBackgroundImage {
526
+- (void)testBackgroundImage {
519
 	Image* backgroundImage = [[Image alloc] initWithValue:[[UIImage alloc] init]];
527
 	Image* backgroundImage = [[Image alloc] initWithValue:[[UIImage alloc] init]];
520
 	self.options.backgroundImage = backgroundImage;
528
 	self.options.backgroundImage = backgroundImage;
521
 	[self.uut viewWillAppear:false];
529
 	[self.uut viewWillAppear:false];

+ 1
- 1
playground/ios/NavigationTests/RNNSideMenuPresenterTest.m View File

17
     [super setUp];
17
     [super setUp];
18
 	self.uut = [[RNNSideMenuPresenter alloc] init];
18
 	self.uut = [[RNNSideMenuPresenter alloc] init];
19
 	self.bindedViewController = [OCMockObject partialMockForObject:[RNNSideMenuController new]];
19
 	self.bindedViewController = [OCMockObject partialMockForObject:[RNNSideMenuController new]];
20
-    [self.uut boundViewController:self.bindedViewController];
20
+    [self.uut bindViewController:self.bindedViewController];
21
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
21
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
22
 }
22
 }
23
 
23
 

+ 42
- 24
playground/ios/NavigationTests/RNNStackPresenterTest.m View File

3
 #import "RNNStackPresenter.h"
3
 #import "RNNStackPresenter.h"
4
 #import "UINavigationController+RNNOptions.h"
4
 #import "UINavigationController+RNNOptions.h"
5
 #import "RNNStackController.h"
5
 #import "RNNStackController.h"
6
+#import "UIImage+Utils.h"
6
 
7
 
7
 @interface RNNStackPresenterTest : XCTestCase
8
 @interface RNNStackPresenterTest : XCTestCase
8
 
9
 
9
 @property (nonatomic, strong) RNNStackPresenter *uut;
10
 @property (nonatomic, strong) RNNStackPresenter *uut;
10
 @property (nonatomic, strong) RNNNavigationOptions *options;
11
 @property (nonatomic, strong) RNNNavigationOptions *options;
11
-@property (nonatomic, strong) id boundViewController;
12
+@property (nonatomic, strong) RNNStackController* boundViewController;
12
 
13
 
13
 @end
14
 @end
14
 
15
 
17
 - (void)setUp {
18
 - (void)setUp {
18
 	[super setUp];
19
 	[super setUp];
19
 	self.uut = [[RNNStackPresenter alloc] init];
20
 	self.uut = [[RNNStackPresenter alloc] init];
20
-	self.boundViewController = [OCMockObject partialMockForObject:[RNNStackController new]];
21
-    [self.uut boundViewController:self.boundViewController];
21
+	RNNStackController* stackController = [[RNNStackController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:self.uut eventEmitter:nil childViewControllers:@[[UIViewController new], [UIViewController new]]];
22
+	self.boundViewController = [OCMockObject partialMockForObject:stackController];
23
+    [self.uut bindViewController:self.boundViewController];
22
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
24
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
23
 }
25
 }
24
 
26
 
25
 - (void)testApplyOptions_shouldSetBackButtonColor_withDefaultValues {
27
 - (void)testApplyOptions_shouldSetBackButtonColor_withDefaultValues {
26
-	[[_boundViewController expect] setBackButtonColor:nil];
28
+	[[(id)_boundViewController expect] setBackButtonColor:nil];
27
 	[self.uut applyOptions:self.options];
29
 	[self.uut applyOptions:self.options];
28
-	[_boundViewController verify];
30
+	[(id)_boundViewController verify];
29
 }
31
 }
30
 
32
 
31
 - (void)testApplyOptions_shouldSetBackButtonColor_withColor {
33
 - (void)testApplyOptions_shouldSetBackButtonColor_withColor {
32
 	self.options.topBar.backButton.color = [[Color alloc] initWithValue:[UIColor redColor]];
34
 	self.options.topBar.backButton.color = [[Color alloc] initWithValue:[UIColor redColor]];
33
-	[[_boundViewController expect] setBackButtonColor:[UIColor redColor]];
35
+	[[(id)_boundViewController expect] setBackButtonColor:[UIColor redColor]];
34
 	[self.uut applyOptions:self.options];
36
 	[self.uut applyOptions:self.options];
35
-	[_boundViewController verify];
37
+	[(id)_boundViewController verify];
36
 }
38
 }
37
 
39
 
38
 - (void)testApplyOptionsBeforePoppingShouldSetTopBarBackgroundForPoppingViewController {
40
 - (void)testApplyOptionsBeforePoppingShouldSetTopBarBackgroundForPoppingViewController {
39
 	_options.topBar.background.color = [[Color alloc] initWithValue:[UIColor redColor]];
41
 	_options.topBar.background.color = [[Color alloc] initWithValue:[UIColor redColor]];
40
 	
42
 	
41
-	[[_boundViewController expect] setTopBarBackgroundColor:_options.topBar.background.color.get];
42
 	[self.uut applyOptionsBeforePopping:self.options];
43
 	[self.uut applyOptionsBeforePopping:self.options];
43
-	[_boundViewController verify];
44
+	XCTAssertTrue([_boundViewController.navigationBar.standardAppearance.backgroundColor isEqual:[UIColor redColor]]);
44
 }
45
 }
45
 
46
 
46
 - (void)testApplyOptionsBeforePoppingShouldSetLargeTitleForPoppingViewController {
47
 - (void)testApplyOptionsBeforePoppingShouldSetLargeTitleForPoppingViewController {
47
 	_options.topBar.largeTitle.visible = [[Bool alloc] initWithBOOL:YES];
48
 	_options.topBar.largeTitle.visible = [[Bool alloc] initWithBOOL:YES];
48
 	
49
 	
49
 	[self.uut applyOptionsBeforePopping:self.options];
50
 	[self.uut applyOptionsBeforePopping:self.options];
50
-	XCTAssertTrue([[self.uut.boundViewController navigationBar] prefersLargeTitles]);
51
+	XCTAssertTrue([[_boundViewController navigationBar] prefersLargeTitles]);
51
 }
52
 }
52
 
53
 
53
 - (void)testApplyOptionsBeforePoppingShouldSetDefaultLargeTitleFalseForPoppingViewController {
54
 - (void)testApplyOptionsBeforePoppingShouldSetDefaultLargeTitleFalseForPoppingViewController {
54
 	_options.topBar.largeTitle.visible = nil;
55
 	_options.topBar.largeTitle.visible = nil;
55
-	
56
 	[self.uut applyOptionsBeforePopping:self.options];
56
 	[self.uut applyOptionsBeforePopping:self.options];
57
-	XCTAssertFalse([[self.uut.boundViewController navigationBar] prefersLargeTitles]);
57
+	XCTAssertFalse([[_boundViewController navigationBar] prefersLargeTitles]);
58
 }
58
 }
59
 
59
 
60
 - (void)testApplyOptions_shouldSetBackButtonOnBoundViewController_withTitle {
60
 - (void)testApplyOptions_shouldSetBackButtonOnBoundViewController_withTitle {
61
 	Text* title = [[Text alloc] initWithValue:@"Title"];
61
 	Text* title = [[Text alloc] initWithValue:@"Title"];
62
 	self.options.topBar.backButton.title = title;
62
 	self.options.topBar.backButton.title = title;
63
-	[[_boundViewController expect] setBackButtonIcon:nil withColor:nil title:title.get showTitle:YES];
64
 	[self.uut applyOptions:self.options];
63
 	[self.uut applyOptions:self.options];
65
-	[_boundViewController verify];
64
+	XCTAssertTrue([self.boundViewController.viewControllers.firstObject.navigationItem.backBarButtonItem.title isEqual:@"Title"]);
66
 }
65
 }
67
 
66
 
68
 - (void)testApplyOptions_shouldSetBackButtonOnBoundViewController_withHideTitle {
67
 - (void)testApplyOptions_shouldSetBackButtonOnBoundViewController_withHideTitle {
69
 	Text* title = [[Text alloc] initWithValue:@"Title"];
68
 	Text* title = [[Text alloc] initWithValue:@"Title"];
70
 	self.options.topBar.backButton.title = title;
69
 	self.options.topBar.backButton.title = title;
71
 	self.options.topBar.backButton.showTitle = [[Bool alloc] initWithValue:@(0)];
70
 	self.options.topBar.backButton.showTitle = [[Bool alloc] initWithValue:@(0)];
72
-	[[(id) self.boundViewController expect] setBackButtonIcon:nil withColor:nil title:title.get showTitle:self.options.topBar.backButton.showTitle.get];
73
 	[self.uut applyOptions:self.options];
71
 	[self.uut applyOptions:self.options];
74
-	[(id)self.boundViewController verify];
72
+	XCTAssertNil(self.boundViewController.viewControllers.firstObject.navigationItem.backBarButtonItem.title);
75
 }
73
 }
76
 
74
 
77
-- (void)testApplyOptions_shouldSetBackButtonOnBoundViewController_withIcon {
78
-	Image* image = [[Image alloc] initWithValue:[UIImage new]];
79
-	self.options.topBar.backButton.icon = image;
80
-	[[(id) self.boundViewController expect] setBackButtonIcon:image.get withColor:nil title:nil showTitle:YES];
75
+- (void)testApplyOptions_shouldSetBackButtonOnBoundViewController_withDefaultValues {
81
 	[self.uut applyOptions:self.options];
76
 	[self.uut applyOptions:self.options];
82
-	[(id)self.boundViewController verify];
77
+	XCTAssertTrue(self.boundViewController.viewControllers.firstObject.navigationItem.backBarButtonItem.title == nil);
83
 }
78
 }
84
 
79
 
85
-- (void)testApplyOptions_shouldSetBackButtonOnBoundViewController_withDefaultValues {
86
-	[[(id) self.boundViewController expect] setBackButtonIcon:nil withColor:nil title:nil showTitle:YES];
80
+- (void)testSetBackButtonIcon_withColor_shouldSetColor {
81
+	Color* color = [[Color alloc] initWithValue:UIColor.redColor];
82
+	self.options.topBar.backButton.color = color;
83
+	[self.uut applyOptions:self.options];
84
+	XCTAssertEqual(self.boundViewController.viewControllers.firstObject.navigationItem.backBarButtonItem.tintColor, UIColor.redColor);
85
+}
86
+
87
+- (void)testSetBackButtonIcon_withColor_shouldSetTitle {
88
+	Color* color = [[Color alloc] initWithValue:UIColor.redColor];
89
+	Text* title = [[Text alloc] initWithValue:@"Title"];
90
+	self.options.topBar.backButton.color = color;
91
+	self.options.topBar.backButton.title = title;
92
+	[self.uut applyOptions:self.options];
93
+	XCTAssertEqual(self.boundViewController.viewControllers.firstObject.navigationItem.backBarButtonItem.tintColor, UIColor.redColor);
94
+	XCTAssertEqual(self.boundViewController.viewControllers.firstObject.navigationItem.backBarButtonItem.title, @"Title");
95
+}
96
+
97
+- (void)testSetBackButtonIcon_withColor_shouldSetIcon {
98
+	Color* color = [[Color alloc] initWithValue:UIColor.redColor];
99
+	UIImage *image = [UIImage emptyImage];
100
+	
101
+	Image* icon = [[Image alloc] initWithValue:image];
102
+	self.options.topBar.backButton.color = color;
103
+	self.options.topBar.backButton.icon = icon;
87
 	[self.uut applyOptions:self.options];
104
 	[self.uut applyOptions:self.options];
88
-	[(id)self.boundViewController verify];
105
+	XCTAssertEqual(self.boundViewController.viewControllers.firstObject.navigationItem.backBarButtonItem.tintColor, UIColor.redColor);
106
+	XCTAssertTrue([self.boundViewController.navigationBar.standardAppearance.backIndicatorImage isEqual:image]);
89
 }
107
 }
90
 
108
 
91
 @end
109
 @end

+ 1
- 1
playground/ios/NavigationTests/RNNTabBarPresenterTest.m View File

18
     [super setUp];
18
     [super setUp];
19
     self.uut = [OCMockObject partialMockForObject:[RNNBottomTabsPresenter new]];
19
     self.uut = [OCMockObject partialMockForObject:[RNNBottomTabsPresenter new]];
20
     self.boundViewController = [OCMockObject partialMockForObject:[RNNBottomTabsController new]];
20
     self.boundViewController = [OCMockObject partialMockForObject:[RNNBottomTabsController new]];
21
-    [self.uut boundViewController:self.boundViewController];
21
+    [self.uut bindViewController:self.boundViewController];
22
     self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
22
     self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
23
 }
23
 }
24
 
24
 

+ 0
- 52
playground/ios/NavigationTests/UINavigationController+RNNOptionsTest.m View File

1
-#import <XCTest/XCTest.h>
2
-#import "UINavigationController+RNNOptions.h"
3
-
4
-@interface UINavigationController_RNNOptionsTest : XCTestCase
5
-
6
-@end
7
-
8
-@implementation UINavigationController_RNNOptionsTest
9
-
10
-- (void)setUp {
11
-    [super setUp];
12
-}
13
-
14
-- (void)testSetBackButtonIcon_withColor_shouldSetColor {
15
-	UIViewController* vc = [UIViewController new];
16
-	UINavigationController* uut = [[UINavigationController alloc] initWithRootViewController:vc];
17
-	UIColor* color = [UIColor blackColor];
18
-
19
-	[uut setBackButtonIcon:nil withColor:color title:nil showTitle:nil];
20
-	XCTAssertEqual(color, vc.navigationItem.backBarButtonItem.tintColor);
21
-}
22
-
23
-- (void)testSetBackButtonIcon_withColor_shouldSetTitle {
24
-	UIViewController* vc = [UIViewController new];
25
-	UINavigationController* uut = [[UINavigationController alloc] initWithRootViewController:vc];
26
-    NSString* title = @"Title";
27
-
28
-    [uut setBackButtonIcon:nil withColor:nil title:title showTitle:YES];
29
-	XCTAssertEqual(title, vc.navigationItem.backBarButtonItem.title);
30
-}
31
-
32
-//- (void)testSetBackButtonIcon_withColor_shouldSetIcon {
33
-//	UIViewController* vc = [UIViewController new];
34
-//	UINavigationController* uut = [[UINavigationController alloc] initWithRootViewController:vc];
35
-//    UIImage* icon = [UIImage new];
36
-//
37
-//    [uut setBackButtonIcon:icon withColor:nil title:nil showTitle:nil];
38
-//	XCTAssertEqual(icon, vc.navigationItem.backBarButtonItem.image);
39
-//}
40
-
41
-- (void)testSetBackButtonIcon_shouldSetTitleOnPreviousViewControllerIfExists {
42
-	UIViewController* viewController1 = [UIViewController new];
43
-	UIViewController* viewController2 = [UIViewController new];
44
-	UINavigationController* uut = [[UINavigationController alloc] init];
45
-	[uut setViewControllers:@[viewController1, viewController2]];
46
-	NSString* title = @"Title";
47
-
48
-	[uut setBackButtonIcon:nil withColor:nil title:title showTitle:YES];
49
-	XCTAssertEqual(title, viewController1.navigationItem.backBarButtonItem.title);
50
-}
51
-
52
-@end

+ 1
- 1
playground/ios/NavigationTests/UIViewController+LayoutProtocolTest.m View File

88
 
88
 
89
     RNNNavigationOptions * childOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
89
     RNNNavigationOptions * childOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
90
     childOptions.bottomTab.text = [[Text alloc] initWithValue:@"Child tab text"];
90
     childOptions.bottomTab.text = [[Text alloc] initWithValue:@"Child tab text"];
91
-    UIViewController* child = [[UIViewController alloc] initWithLayoutInfo:nil creator:nil options:childOptions defaultOptions:nil presenter:presenter eventEmitter:nil childViewControllers:nil];
91
+    UIViewController* child = [[UIViewController alloc] initWithLayoutInfo:nil creator:nil options:childOptions defaultOptions:nil presenter:[RNNComponentPresenter new] eventEmitter:nil childViewControllers:nil];
92
     RNNNavigationOptions * initialOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
92
     RNNNavigationOptions * initialOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
93
     initialOptions.topBar.title.text = [[Text alloc] initWithValue:@"Initial title"];
93
     initialOptions.topBar.title.text = [[Text alloc] initWithValue:@"Initial title"];
94
     RNNStackController* uut = [[RNNStackController alloc] initWithLayoutInfo:nil creator:nil options:initialOptions defaultOptions:nil presenter:presenter eventEmitter:nil childViewControllers:@[child]];
94
     RNNStackController* uut = [[RNNStackController alloc] initWithLayoutInfo:nil creator:nil options:initialOptions defaultOptions:nil presenter:presenter eventEmitter:nil childViewControllers:@[child]];

+ 9
- 0
playground/ios/NavigationTests/utils/UIImage+Utils.h View File

1
+#import <UIKit/UIKit.h>
2
+
3
+@interface UIImage (Utils)
4
+
5
++ (UIImage*)emptyImage;
6
+
7
+- (BOOL)isEqual:(UIImage *)image;
8
+
9
+@end

+ 19
- 0
playground/ios/NavigationTests/utils/UIImage+Utils.m View File

1
+#import "UIImage+Utils.h"
2
+
3
+@implementation UIImage (Utils)
4
+
5
++ (UIImage*)emptyImage {
6
+	UIGraphicsBeginImageContext(CGSizeMake(10, 10));
7
+    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
8
+    UIGraphicsEndImageContext();
9
+	return image;
10
+}
11
+
12
+- (BOOL)isEqual:(UIImage *)image {
13
+    NSData *data1 = UIImagePNGRepresentation(self);
14
+    NSData *data2 = UIImagePNGRepresentation(image);
15
+
16
+    return [super isEqual:image] || [data1 isEqual:data2];
17
+}
18
+
19
+@end

+ 6
- 4
playground/ios/playground.xcodeproj/project.pbxproj View File

11
 		13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
11
 		13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
12
 		13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
12
 		13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13
 		13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
13
 		13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14
+		501C86B9239FE9C400E0B631 /* UIImage+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 501C86B8239FE9C400E0B631 /* UIImage+Utils.m */; };
14
 		50451D35204451A900695F00 /* RNNCustomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50451D34204451A800695F00 /* RNNCustomViewController.m */; };
15
 		50451D35204451A900695F00 /* RNNCustomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50451D34204451A800695F00 /* RNNCustomViewController.m */; };
15
 		9D204F3DC4FBCD81583BF99F /* Pods_playground.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A3340545EAAF11C1F146864 /* Pods_playground.framework */; };
16
 		9D204F3DC4FBCD81583BF99F /* Pods_playground.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A3340545EAAF11C1F146864 /* Pods_playground.framework */; };
16
 		E5046080227748EA00212BD8 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E504607F227748EA00212BD8 /* JavaScriptCore.framework */; };
17
 		E5046080227748EA00212BD8 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E504607F227748EA00212BD8 /* JavaScriptCore.framework */; };
30
 		E58D26532385888C003F36BA /* RNNSideMenuPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26362385888B003F36BA /* RNNSideMenuPresenterTest.m */; };
31
 		E58D26532385888C003F36BA /* RNNSideMenuPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26362385888B003F36BA /* RNNSideMenuPresenterTest.m */; };
31
 		E58D26542385888C003F36BA /* RNNSideMenuControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26372385888B003F36BA /* RNNSideMenuControllerTest.m */; };
32
 		E58D26542385888C003F36BA /* RNNSideMenuControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26372385888B003F36BA /* RNNSideMenuControllerTest.m */; };
32
 		E58D26552385888C003F36BA /* RNNTransitionStateHolderTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */; };
33
 		E58D26552385888C003F36BA /* RNNTransitionStateHolderTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */; };
33
-		E58D26562385888C003F36BA /* UINavigationController+RNNOptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26392385888B003F36BA /* UINavigationController+RNNOptionsTest.m */; };
34
 		E58D26572385888C003F36BA /* RNNTabBarPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263A2385888C003F36BA /* RNNTabBarPresenterTest.m */; };
34
 		E58D26572385888C003F36BA /* RNNTabBarPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263A2385888C003F36BA /* RNNTabBarPresenterTest.m */; };
35
 		E58D26582385888C003F36BA /* UITabBarController+RNNOptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */; };
35
 		E58D26582385888C003F36BA /* UITabBarController+RNNOptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */; };
36
 		E58D26592385888C003F36BA /* RNNNavigationStackManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263C2385888C003F36BA /* RNNNavigationStackManagerTest.m */; };
36
 		E58D26592385888C003F36BA /* RNNNavigationStackManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263C2385888C003F36BA /* RNNNavigationStackManagerTest.m */; };
66
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
66
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
67
 		4259AF43A23D928FE78B4A3A /* Pods-NavigationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NavigationTests.debug.xcconfig"; path = "Target Support Files/Pods-NavigationTests/Pods-NavigationTests.debug.xcconfig"; sourceTree = "<group>"; };
67
 		4259AF43A23D928FE78B4A3A /* Pods-NavigationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NavigationTests.debug.xcconfig"; path = "Target Support Files/Pods-NavigationTests/Pods-NavigationTests.debug.xcconfig"; sourceTree = "<group>"; };
68
 		4A3340545EAAF11C1F146864 /* Pods_playground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_playground.framework; sourceTree = BUILT_PRODUCTS_DIR; };
68
 		4A3340545EAAF11C1F146864 /* Pods_playground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_playground.framework; sourceTree = BUILT_PRODUCTS_DIR; };
69
+		501C86B7239FE9C400E0B631 /* UIImage+Utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+Utils.h"; sourceTree = "<group>"; };
70
+		501C86B8239FE9C400E0B631 /* UIImage+Utils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Utils.m"; sourceTree = "<group>"; };
69
 		50364D69238E7ECC000E62A2 /* Pods_playground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_playground.framework; sourceTree = BUILT_PRODUCTS_DIR; };
71
 		50364D69238E7ECC000E62A2 /* Pods_playground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_playground.framework; sourceTree = BUILT_PRODUCTS_DIR; };
70
 		50364D6B238E7F0A000E62A2 /* ReactNativeNavigation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ReactNativeNavigation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
72
 		50364D6B238E7F0A000E62A2 /* ReactNativeNavigation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ReactNativeNavigation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
71
 		50451D33204451A800695F00 /* RNNCustomViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNNCustomViewController.h; path = ../../../lib/ios/RNNCustomViewController.h; sourceTree = "<group>"; };
73
 		50451D33204451A800695F00 /* RNNCustomViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNNCustomViewController.h; path = ../../../lib/ios/RNNCustomViewController.h; sourceTree = "<group>"; };
96
 		E58D26362385888B003F36BA /* RNNSideMenuPresenterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuPresenterTest.m; sourceTree = "<group>"; };
98
 		E58D26362385888B003F36BA /* RNNSideMenuPresenterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuPresenterTest.m; sourceTree = "<group>"; };
97
 		E58D26372385888B003F36BA /* RNNSideMenuControllerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuControllerTest.m; sourceTree = "<group>"; };
99
 		E58D26372385888B003F36BA /* RNNSideMenuControllerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuControllerTest.m; sourceTree = "<group>"; };
98
 		E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNTransitionStateHolderTest.m; sourceTree = "<group>"; };
100
 		E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNTransitionStateHolderTest.m; sourceTree = "<group>"; };
99
-		E58D26392385888B003F36BA /* UINavigationController+RNNOptionsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+RNNOptionsTest.m"; sourceTree = "<group>"; };
100
 		E58D263A2385888C003F36BA /* RNNTabBarPresenterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNTabBarPresenterTest.m; sourceTree = "<group>"; };
101
 		E58D263A2385888C003F36BA /* RNNTabBarPresenterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNTabBarPresenterTest.m; sourceTree = "<group>"; };
101
 		E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITabBarController+RNNOptionsTest.m"; sourceTree = "<group>"; };
102
 		E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITabBarController+RNNOptionsTest.m"; sourceTree = "<group>"; };
102
 		E58D263C2385888C003F36BA /* RNNNavigationStackManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNNavigationStackManagerTest.m; sourceTree = "<group>"; };
103
 		E58D263C2385888C003F36BA /* RNNNavigationStackManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNNavigationStackManagerTest.m; sourceTree = "<group>"; };
229
 				E58D26342385888B003F36BA /* RNNTestRootViewCreator.h */,
230
 				E58D26342385888B003F36BA /* RNNTestRootViewCreator.h */,
230
 				E58D263D2385888C003F36BA /* RNNTestRootViewCreator.m */,
231
 				E58D263D2385888C003F36BA /* RNNTestRootViewCreator.m */,
231
 				E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */,
232
 				E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */,
232
-				E58D26392385888B003F36BA /* UINavigationController+RNNOptionsTest.m */,
233
 				E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */,
233
 				E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */,
234
 				E58D26252385888B003F36BA /* UIViewController+LayoutProtocolTest.m */,
234
 				E58D26252385888B003F36BA /* UIViewController+LayoutProtocolTest.m */,
235
 				E58D263E2385888C003F36BA /* UIViewController+RNNOptionsTest.m */,
235
 				E58D263E2385888C003F36BA /* UIViewController+RNNOptionsTest.m */,
244
 			children = (
244
 			children = (
245
 				E58D262F2385888B003F36BA /* RNNTestBase.m */,
245
 				E58D262F2385888B003F36BA /* RNNTestBase.m */,
246
 				E58D26302385888B003F36BA /* RNNTestBase.h */,
246
 				E58D26302385888B003F36BA /* RNNTestBase.h */,
247
+				501C86B7239FE9C400E0B631 /* UIImage+Utils.h */,
248
+				501C86B8239FE9C400E0B631 /* UIImage+Utils.m */,
247
 			);
249
 			);
248
 			path = utils;
250
 			path = utils;
249
 			sourceTree = "<group>";
251
 			sourceTree = "<group>";
566
 				E58D265B2385888C003F36BA /* UIViewController+RNNOptionsTest.m in Sources */,
568
 				E58D265B2385888C003F36BA /* UIViewController+RNNOptionsTest.m in Sources */,
567
 				E58D26532385888C003F36BA /* RNNSideMenuPresenterTest.m in Sources */,
569
 				E58D26532385888C003F36BA /* RNNSideMenuPresenterTest.m in Sources */,
568
 				E58D264D2385888C003F36BA /* RNNOverlayManagerTest.m in Sources */,
570
 				E58D264D2385888C003F36BA /* RNNOverlayManagerTest.m in Sources */,
571
+				501C86B9239FE9C400E0B631 /* UIImage+Utils.m in Sources */,
569
 				E58D265F2385888C003F36BA /* RNNBasePresenterTest.m in Sources */,
572
 				E58D265F2385888C003F36BA /* RNNBasePresenterTest.m in Sources */,
570
 				E58D26542385888C003F36BA /* RNNSideMenuControllerTest.m in Sources */,
573
 				E58D26542385888C003F36BA /* RNNSideMenuControllerTest.m in Sources */,
571
 				E58D264A2385888C003F36BA /* RNNTabBarControllerTest.m in Sources */,
574
 				E58D264A2385888C003F36BA /* RNNTabBarControllerTest.m in Sources */,
572
 				E58D26472385888C003F36BA /* RNNRootViewControllerTest.m in Sources */,
575
 				E58D26472385888C003F36BA /* RNNRootViewControllerTest.m in Sources */,
573
 				E58D26582385888C003F36BA /* UITabBarController+RNNOptionsTest.m in Sources */,
576
 				E58D26582385888C003F36BA /* UITabBarController+RNNOptionsTest.m in Sources */,
574
 				E58D265A2385888C003F36BA /* RNNTestRootViewCreator.m in Sources */,
577
 				E58D265A2385888C003F36BA /* RNNTestRootViewCreator.m in Sources */,
575
-				E58D26562385888C003F36BA /* UINavigationController+RNNOptionsTest.m in Sources */,
576
 				E58D26492385888C003F36BA /* RNNFontAttributesCreatorTest.m in Sources */,
578
 				E58D26492385888C003F36BA /* RNNFontAttributesCreatorTest.m in Sources */,
577
 				E58D26552385888C003F36BA /* RNNTransitionStateHolderTest.m in Sources */,
579
 				E58D26552385888C003F36BA /* RNNTransitionStateHolderTest.m in Sources */,
578
 				E58D26462385888C003F36BA /* UIViewController+LayoutProtocolTest.m in Sources */,
580
 				E58D26462385888C003F36BA /* UIViewController+LayoutProtocolTest.m in Sources */,