Bläddra i källkod

Fix topBar transparent background on iOS 12 (#5791)

* Fix topBar transparent background on iOS 12

* Fix unit test iOS destination
Yogev Ben David 5 år sedan
förälder
incheckning
cd3d3472fc
No account linked to committer's email address

+ 0
- 4
lib/ios/TopBarAppearancePresenter.m Visa fil

@@ -45,10 +45,6 @@
45 45
     }
46 46
 }
47 47
 
48
-- (BOOL)transparent {
49
-    return (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) == 0.0);
50
-}
51
-
52 48
 - (void)showBorder:(BOOL)showBorder {
53 49
     UIColor* shadowColor = showBorder ? [[UINavigationBarAppearance new] shadowColor] : nil;
54 50
     _appearance.shadowColor = shadowColor;

+ 2
- 1
lib/ios/TopBarPresenter.h Visa fil

@@ -11,7 +11,8 @@
11 11
 
12 12
 - (instancetype)initWithNavigationController:(UINavigationController *)boundNavigationController;
13 13
 
14
-@property (nonatomic) BOOL transparent;
14
+- (BOOL)transparent;
15
+
15 16
 @property (nonatomic) BOOL translucent;
16 17
 @property (nonatomic, strong) UIColor* backgroundColor;
17 18
 

+ 5
- 1
lib/ios/TopBarPresenter.m Visa fil

@@ -69,7 +69,7 @@
69 69
 }
70 70
 
71 71
 - (void)updateBackgroundAppearance {
72
-    if (_transparent) {
72
+    if (self.transparent) {
73 73
         [self setBackgroundColorTransparent];
74 74
     } else if (_backgroundColor) {
75 75
         self.navigationController.navigationBar.barTintColor = _backgroundColor;
@@ -125,4 +125,8 @@
125 125
     lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
126 126
 }
127 127
 
128
+- (BOOL)transparent {
129
+    return (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) == 0.0);
130
+}
131
+
128 132
 @end

+ 22
- 0
playground/ios/NavigationIOS12Tests/Info.plist Visa fil

@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>CFBundleDevelopmentRegion</key>
6
+	<string>$(DEVELOPMENT_LANGUAGE)</string>
7
+	<key>CFBundleExecutable</key>
8
+	<string>$(EXECUTABLE_NAME)</string>
9
+	<key>CFBundleIdentifier</key>
10
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+	<key>CFBundleInfoDictionaryVersion</key>
12
+	<string>6.0</string>
13
+	<key>CFBundleName</key>
14
+	<string>$(PRODUCT_NAME)</string>
15
+	<key>CFBundlePackageType</key>
16
+	<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17
+	<key>CFBundleShortVersionString</key>
18
+	<string>1.0</string>
19
+	<key>CFBundleVersion</key>
20
+	<string>1</string>
21
+</dict>
22
+</plist>

+ 566
- 0
playground/ios/NavigationIOS12Tests/RNNRootViewControllerTest.m Visa fil

@@ -0,0 +1,566 @@
1
+#import <XCTest/XCTest.h>
2
+#import <OCMock/OCMock.h>
3
+#import <ReactNativeNavigation/RNNComponentViewController.h>
4
+#import "RNNReactRootViewCreator.h"
5
+#import "RNNTestRootViewCreator.h"
6
+#import <React/RCTConvert.h>
7
+#import "RNNNavigationOptions.h"
8
+#import "RNNStackController.h"
9
+#import "RNNBottomTabsController.h"
10
+#import "RNNUIBarButtonItem.h"
11
+
12
+
13
+@interface RNNComponentViewController (EmbedInTabBar)
14
+- (void)embedInTabBarController;
15
+@end
16
+
17
+@implementation RNNComponentViewController (EmbedInTabBar)
18
+
19
+- (void)embedInTabBarController {
20
+	RNNBottomTabsController* tabVC = [[RNNBottomTabsController alloc] init];
21
+	tabVC.viewControllers = @[self];
22
+	[self viewWillAppear:false];
23
+}
24
+
25
+@end
26
+
27
+@interface RNNRootViewControllerTest : XCTestCase
28
+
29
+@property (nonatomic, strong) id<RNNComponentViewCreator> creator;
30
+@property (nonatomic, strong) NSString* pageName;
31
+@property (nonatomic, strong) NSString* componentId;
32
+@property (nonatomic, strong) id emitter;
33
+@property (nonatomic, strong) RNNNavigationOptions* options;
34
+@property (nonatomic, strong) RNNLayoutInfo* layoutInfo;
35
+@property (nonatomic, strong) RNNComponentViewController* uut;
36
+@end
37
+
38
+@implementation RNNRootViewControllerTest
39
+
40
+- (void)setUp {
41
+	[super setUp];
42
+	self.creator = [[RNNTestRootViewCreator alloc] init];
43
+	self.pageName = @"somename";
44
+	self.componentId = @"cntId";
45
+	self.emitter = nil;
46
+	self.options = [[RNNNavigationOptions alloc] initWithDict:@{}];
47
+	
48
+	RNNLayoutInfo* layoutInfo = [RNNLayoutInfo new];
49
+	layoutInfo.componentId = self.componentId;
50
+	layoutInfo.name = self.pageName;
51
+	
52
+	id presenter = [OCMockObject partialMockForObject:[[RNNComponentPresenter alloc] init]];
53
+	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:layoutInfo rootViewCreator:self.creator eventEmitter:self.emitter presenter:presenter options:self.options defaultOptions:nil];
54
+}
55
+
56
+-(void)testTopBarBackgroundColor_validColor{
57
+	NSNumber* inputColor = @(0xFFFF0000);
58
+	self.options.topBar.background.color = [[Color alloc] initWithValue:[RCTConvert UIColor:inputColor]];
59
+	__unused RNNStackController* nav = [self createNavigationController];
60
+	[self.uut viewWillAppear:false];
61
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
62
+
63
+	XCTAssertTrue([self.uut.navigationController.navigationBar.barTintColor isEqual:expectedColor]);
64
+}
65
+
66
+-(void)testTopBarBackgroundColorWithoutNavigationController{
67
+	NSNumber* inputColor = @(0xFFFF0000);
68
+	self.options.topBar.background.color = [[Color alloc] initWithValue:[RCTConvert UIColor:inputColor]];
69
+
70
+	XCTAssertNoThrow([self.uut viewWillAppear:false]);
71
+}
72
+
73
+- (void)testStatusBarHidden_default {
74
+	[self.uut viewWillAppear:false];
75
+
76
+	XCTAssertFalse([self.uut prefersStatusBarHidden]);
77
+}
78
+
79
+- (void)testStatusBarVisible_false {
80
+	self.options.statusBar.visible = [[Bool alloc] initWithValue:@(0)];
81
+	[self.uut viewWillAppear:false];
82
+
83
+	XCTAssertTrue([self.uut prefersStatusBarHidden]);
84
+}
85
+
86
+- (void)testStatusBarVisible_true {
87
+	self.options.statusBar.visible = [[Bool alloc] initWithValue:@(1)];
88
+	[self.uut viewWillAppear:false];
89
+	
90
+	XCTAssertFalse([self.uut prefersStatusBarHidden]);
91
+}
92
+
93
+- (void)testStatusBarHideWithTopBar_false {
94
+	self.options.statusBar.hideWithTopBar = [[Bool alloc] initWithValue:@(0)];
95
+	self.options.topBar.visible = [[Bool alloc] initWithValue:@(0)];
96
+	[self.uut viewWillAppear:false];
97
+
98
+	XCTAssertFalse([self.uut prefersStatusBarHidden]);
99
+}
100
+
101
+- (void)testStatusBarHideWithTopBar_true {
102
+	self.options.statusBar.hideWithTopBar = [[Bool alloc] initWithValue:@(1)];
103
+	self.options.topBar.visible = [[Bool alloc] initWithValue:@(0)];
104
+	__unused RNNStackController* nav = [self createNavigationController];
105
+
106
+	[self.uut viewWillAppear:false];
107
+
108
+	XCTAssertTrue([self.uut prefersStatusBarHidden]);
109
+}
110
+
111
+-(void)testTitle_string{
112
+	NSString* title =@"some title";
113
+	self.options.topBar.title.text = [[Text alloc] initWithValue:title];
114
+
115
+	[self.uut viewWillAppear:false];
116
+	XCTAssertTrue([self.uut.navigationItem.title isEqual:title]);
117
+}
118
+
119
+-(void)testTitle_default{
120
+	[self.uut viewWillAppear:false];
121
+	XCTAssertNil(self.uut.navigationItem.title);
122
+}
123
+
124
+-(void)testTopBarTextColor_validColor{
125
+	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
126
+	self.options.topBar.title.color = [[Color alloc] initWithValue:inputColor];
127
+	__unused RNNStackController* nav = [self createNavigationController];
128
+	[self.uut viewWillAppear:false];
129
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
130
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
131
+}
132
+
133
+-(void)testbackgroundColor_validColor{
134
+	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
135
+	self.options.layout.backgroundColor = [[Color alloc] initWithValue:inputColor];
136
+	[self.uut viewWillAppear:false];
137
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
138
+	XCTAssertTrue([self.uut.view.backgroundColor isEqual:expectedColor]);
139
+}
140
+
141
+-(void)testTopBarTextFontFamily_validFont{
142
+	NSString* inputFont = @"HelveticaNeue";
143
+	__unused RNNStackController* nav = [self createNavigationController];
144
+	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
145
+	[self.uut viewWillAppear:false];
146
+	UIFont* expectedFont = [UIFont fontWithName:inputFont size:17];
147
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
148
+}
149
+
150
+-(void)testTopBarHideOnScroll_true {
151
+	NSNumber* hideOnScrollInput = @(1);
152
+	__unused RNNStackController* nav = [self createNavigationController];
153
+	self.options.topBar.hideOnScroll = [[Bool alloc] initWithValue:hideOnScrollInput];;
154
+	[self.uut viewWillAppear:false];
155
+	XCTAssertTrue(self.uut.navigationController.hidesBarsOnSwipe);
156
+}
157
+
158
+-(void)testTopBarTranslucent {
159
+	NSNumber* topBarTranslucentInput = @(0);
160
+	self.options.topBar.background.translucent = [[Bool alloc] initWithValue:topBarTranslucentInput];
161
+	__unused RNNStackController* nav = [self createNavigationController];
162
+	[self.uut viewWillAppear:false];
163
+	XCTAssertFalse(self.uut.navigationController.navigationBar.translucent);
164
+}
165
+
166
+-(void)testTabBadge {
167
+	NSString* tabBadgeInput = @"5";
168
+	self.options.bottomTab.badge = [[Text alloc] initWithValue:tabBadgeInput];
169
+	__unused RNNBottomTabsController* vc = [[RNNBottomTabsController alloc] init];
170
+	NSMutableArray* controllers = [NSMutableArray new];
171
+	UITabBarItem* item = [[UITabBarItem alloc] initWithTitle:@"A Tab" image:nil tag:1];
172
+	[self.uut setTabBarItem:item];
173
+	[controllers addObject:self.uut];
174
+	[vc setViewControllers:controllers];
175
+	[self.uut viewWillAppear:false];
176
+	XCTAssertTrue([self.uut.tabBarItem.badgeValue isEqualToString:tabBadgeInput]);
177
+
178
+}
179
+
180
+-(void)testTopBarTransparent_BOOL_True {
181
+	UIColor* transparentColor = [RCTConvert UIColor:@(0x00000000)];
182
+	self.options.topBar.background.color = [[Color alloc] initWithValue:transparentColor];
183
+	__unused RNNStackController* nav = [self createNavigationController];
184
+	[self.uut viewWillAppear:false];
185
+	
186
+	nav.navigationBar.barTintColor = UIColor.clearColor;
187
+	XCTAssertTrue([nav.navigationBar.barTintColor isEqual:UIColor.clearColor]);
188
+}
189
+
190
+-(void)testTopBarTransparent_BOOL_false {
191
+	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
192
+	__unused RNNStackController* nav = [self createNavigationController];
193
+	self.options.topBar.background.color = [[Color alloc] initWithValue:inputColor];
194
+	[self.uut viewWillAppear:false];
195
+
196
+	XCTAssertFalse([nav.navigationBar.barTintColor isEqual:UIColor.clearColor]);
197
+}
198
+
199
+-(void)testTopBarLargeTitle_default {
200
+	[self.uut viewWillAppear:false];
201
+
202
+	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode,  UINavigationItemLargeTitleDisplayModeNever);
203
+}
204
+
205
+-(void)testTopBarLargeTitle_true {
206
+	self.options.topBar.largeTitle.visible = [[Bool alloc] initWithValue:@(1)];
207
+	[self.uut viewWillAppear:false];
208
+	
209
+	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
210
+}
211
+
212
+-(void)testTopBarLargeTitle_false {
213
+	self.options.topBar.largeTitle.visible = [[Bool alloc] initWithValue:@(0)];
214
+	[self.uut viewWillAppear:false];
215
+	
216
+	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeNever);
217
+}
218
+
219
+
220
+-(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withoutTextColor {
221
+	NSNumber* topBarTextFontSizeInput = @(15);
222
+	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
223
+	__unused RNNStackController* nav = [self createNavigationController];
224
+	[self.uut viewWillAppear:false];
225
+	UIFont* expectedFont = [UIFont systemFontOfSize:15];
226
+
227
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
228
+}
229
+
230
+-(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withTextColor {
231
+	NSNumber* topBarTextFontSizeInput = @(15);
232
+	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
233
+	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
234
+	self.options.topBar.largeTitle.color = [[Color alloc] initWithValue:inputColor];
235
+	__unused RNNStackController* nav = [self createNavigationController];
236
+	[self.uut viewWillAppear:false];
237
+	UIFont* expectedFont = [UIFont systemFontOfSize:15];
238
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
239
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
240
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
241
+}
242
+
243
+-(void)testTopBarLargeTitleFontSize_withTextFontFamily_withTextColor {
244
+	NSNumber* topBarTextFontSizeInput = @(15);
245
+	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
246
+	NSString* inputFont = @"HelveticaNeue";
247
+	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
248
+	self.options.topBar.largeTitle.color = [[Color alloc] initWithValue:inputColor];
249
+	self.options.topBar.largeTitle.fontFamily = [[Text alloc] initWithValue:inputFont];
250
+	
251
+	__unused RNNStackController* nav = [self createNavigationController];
252
+	[self.uut viewWillAppear:false];
253
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
254
+	UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
255
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
256
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
257
+}
258
+
259
+-(void)testTopBarLargeTitleFontSize_withTextFontFamily_withoutTextColor {
260
+	NSNumber* topBarTextFontSizeInput = @(15);
261
+	NSString* inputFont = @"HelveticaNeue";
262
+	self.options.topBar.largeTitle.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
263
+	self.options.topBar.largeTitle.fontFamily = [[Text alloc] initWithValue:inputFont];
264
+	__unused RNNStackController* nav = [self createNavigationController];
265
+	[self.uut viewWillAppear:false];
266
+	UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
267
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
268
+}
269
+
270
+
271
+-(void)testTopBarTextFontSize_withoutTextFontFamily_withoutTextColor {
272
+	NSNumber* topBarTextFontSizeInput = @(15);
273
+	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
274
+	__unused RNNStackController* nav = [self createNavigationController];
275
+	[self.uut viewWillAppear:false];
276
+	UIFont* expectedFont = [UIFont systemFontOfSize:15];
277
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
278
+}
279
+
280
+-(void)testTopBarTextFontSize_withoutTextFontFamily_withTextColor {
281
+	NSNumber* topBarTextFontSizeInput = @(15);
282
+	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
283
+	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
284
+	self.options.topBar.title.color = [[Color alloc] initWithValue:inputColor];
285
+	__unused RNNStackController* nav = [self createNavigationController];
286
+	[self.uut viewWillAppear:false];
287
+	UIFont* expectedFont = [UIFont systemFontOfSize:15];
288
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
289
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
290
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
291
+}
292
+
293
+-(void)testTopBarTextFontSize_withTextFontFamily_withTextColor {
294
+	NSNumber* topBarTextFontSizeInput = @(15);
295
+	UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)];
296
+	NSString* inputFont = @"HelveticaNeue";
297
+	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
298
+	self.options.topBar.title.color = [[Color alloc] initWithValue:inputColor];
299
+	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
300
+	__unused RNNStackController* nav = [self createNavigationController];
301
+	[self.uut viewWillAppear:false];
302
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
303
+	UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
304
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
305
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSColor"] isEqual:expectedColor]);
306
+}
307
+
308
+-(void)testTopBarTextFontSize_withTextFontFamily_withoutTextColor {
309
+	NSNumber* topBarTextFontSizeInput = @(15);
310
+	NSString* inputFont = @"HelveticaNeue";
311
+	self.options.topBar.title.fontSize = [[Number alloc] initWithValue:topBarTextFontSizeInput];
312
+	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
313
+	__unused RNNStackController* nav = [self createNavigationController];
314
+	[self.uut viewWillAppear:false];
315
+	UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
316
+	XCTAssertTrue([self.uut.navigationController.navigationBar.titleTextAttributes[@"NSFont"] isEqual:expectedFont]);
317
+}
318
+
319
+// TODO: Currently not passing
320
+-(void)testTopBarTextFontFamily_invalidFont{
321
+	NSString* inputFont = @"HelveticaNeueeeee";
322
+	__unused RNNStackController* nav = [self createNavigationController];
323
+	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
324
+	//	XCTAssertThrows([self.uut viewWillAppear:false]);
325
+}
326
+
327
+-(void)testOrientation_portrait {
328
+	NSArray* supportedOrientations = @[@"portrait"];
329
+	self.options.layout.orientation = supportedOrientations;
330
+	__unused RNNStackController* nav = [self createNavigationController];
331
+	[self.uut viewWillAppear:false];
332
+	UIInterfaceOrientationMask expectedOrientation = UIInterfaceOrientationMaskPortrait;
333
+	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
334
+}
335
+
336
+-(void)testOrientation_portraitString {
337
+	NSString* supportedOrientation = @"portrait";
338
+	self.options.layout.orientation = supportedOrientation;
339
+	__unused RNNStackController* nav = [self createNavigationController];
340
+	[self.uut viewWillAppear:false];
341
+	UIInterfaceOrientationMask expectedOrientation = (UIInterfaceOrientationMaskPortrait);
342
+	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
343
+}
344
+
345
+-(void)testOrientation_portraitAndLandscape {
346
+	NSArray* supportedOrientations = @[@"portrait", @"landscape"];
347
+	self.options.layout.orientation = supportedOrientations;
348
+	__unused RNNStackController* nav = [self createNavigationController];
349
+	[self.uut viewWillAppear:false];
350
+	UIInterfaceOrientationMask expectedOrientation = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscape);
351
+	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
352
+}
353
+
354
+-(void)testOrientation_all {
355
+	NSArray* supportedOrientations = @[@"all"];
356
+	self.options.layout.orientation = supportedOrientations;
357
+	__unused RNNStackController* nav = [self createNavigationController];
358
+	[self.uut viewWillAppear:false];
359
+	UIInterfaceOrientationMask expectedOrientation = UIInterfaceOrientationMaskAll;
360
+	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
361
+}
362
+
363
+-(void)testOrientation_default {
364
+	NSString* supportedOrientations = @"default";
365
+	self.options.layout.orientation = supportedOrientations;
366
+	__unused RNNStackController* nav = [self createNavigationController];
367
+	[self.uut viewWillAppear:false];
368
+	UIInterfaceOrientationMask expectedOrientation = [[UIApplication sharedApplication] supportedInterfaceOrientationsForWindow:[[UIApplication sharedApplication] keyWindow]];
369
+	XCTAssertTrue(self.uut.navigationController.supportedInterfaceOrientations == expectedOrientation);
370
+}
371
+
372
+
373
+-(void)testOrientationTabsController_portrait {
374
+	NSArray* supportedOrientations = @[@"portrait"];
375
+	self.options.layout.orientation = supportedOrientations;
376
+	NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
377
+    __unused RNNBottomTabsController* vc = [[RNNBottomTabsController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[RNNComponentPresenter new] eventEmitter:nil childViewControllers:controllers];
378
+
379
+	[self.uut viewWillAppear:false];
380
+
381
+	UIInterfaceOrientationMask expectedOrientation = UIInterfaceOrientationMaskPortrait;
382
+	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
383
+}
384
+
385
+-(void)testOrientationTabsController_portraitAndLandscape {
386
+	NSArray* supportedOrientations = @[@"portrait", @"landscape"];
387
+	self.options.layout.orientation = supportedOrientations;
388
+    NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
389
+    __unused RNNBottomTabsController* vc = [[RNNBottomTabsController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[RNNComponentPresenter new] eventEmitter:nil childViewControllers:controllers];
390
+
391
+	[self.uut viewWillAppear:false];
392
+
393
+	UIInterfaceOrientationMask expectedOrientation = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscape);
394
+	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
395
+}
396
+
397
+-(void)testOrientationTabsController_all {
398
+	NSArray* supportedOrientations = @[@"all"];
399
+	self.options.layout.orientation = supportedOrientations;
400
+	NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
401
+	__unused RNNBottomTabsController* vc = [[RNNBottomTabsController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[RNNComponentPresenter new] eventEmitter:nil childViewControllers:controllers];
402
+
403
+	[self.uut viewWillAppear:false];
404
+
405
+	UIInterfaceOrientationMask expectedOrientation = UIInterfaceOrientationMaskAll;
406
+	XCTAssertTrue(self.uut.tabBarController.supportedInterfaceOrientations == expectedOrientation);
407
+}
408
+
409
+-(void)testRightButtonsWithTitle_withoutStyle {
410
+	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"text": @"test"}];
411
+	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
412
+	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
413
+
414
+	RNNUIBarButtonItem* button = (RNNUIBarButtonItem*) nav.topViewController.navigationItem.rightBarButtonItems[0];
415
+	NSString* expectedButtonId = @"testId";
416
+	NSString* expectedTitle = @"test";
417
+	XCTAssertTrue([button.buttonId isEqualToString:expectedButtonId]);
418
+	XCTAssertTrue([button.title isEqualToString:expectedTitle]);
419
+	XCTAssertTrue(button.enabled);
420
+}
421
+
422
+-(void)testRightButtonsWithTitle_withStyle {
423
+	NSNumber* inputColor = @(0xFFFF0000);
424
+
425
+	self.options.topBar.rightButtons = @[@{@"id": @"testId", @"text": @"test", @"enabled": @false, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
426
+	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
427
+	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
428
+
429
+	RNNUIBarButtonItem* button = (RNNUIBarButtonItem*)[nav.topViewController.navigationItem.rightBarButtonItems objectAtIndex:0];
430
+	NSString* expectedButtonId = @"testId";
431
+	NSString* expectedTitle = @"test";
432
+	XCTAssertTrue([button.buttonId isEqualToString:expectedButtonId]);
433
+	XCTAssertTrue([button.title isEqualToString:expectedTitle]);
434
+	XCTAssertFalse(button.enabled);
435
+
436
+	//TODO: Determine how to tests buttonColor,buttonFontSize and buttonFontWeight?
437
+}
438
+
439
+-(void)testLeftButtonsWithTitle_withoutStyle {
440
+	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"text": @"test"}];
441
+	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
442
+	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
443
+	
444
+	RNNUIBarButtonItem* button = (RNNUIBarButtonItem*)[nav.topViewController.navigationItem.leftBarButtonItems objectAtIndex:0];
445
+	NSString* expectedButtonId = @"testId";
446
+	NSString* expectedTitle = @"test";
447
+	XCTAssertTrue([button.buttonId isEqualToString:expectedButtonId]);
448
+	XCTAssertTrue([button.title isEqualToString:expectedTitle]);
449
+	XCTAssertTrue(button.enabled);
450
+}
451
+
452
+-(void)testLeftButtonsWithTitle_withStyle {
453
+	NSNumber* inputColor = @(0xFFFF0000);
454
+
455
+	self.options.topBar.leftButtons = @[@{@"id": @"testId", @"text": @"test", @"enabled": @false, @"buttonColor": inputColor, @"buttonFontSize": @22, @"buttonFontWeight": @"800"}];
456
+	self.uut = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:self.options defaultOptions:nil];
457
+	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
458
+
459
+	RNNUIBarButtonItem* button = (RNNUIBarButtonItem*)[nav.topViewController.navigationItem.leftBarButtonItems objectAtIndex:0];
460
+	NSString* expectedButtonId = @"testId";
461
+	NSString* expectedTitle = @"test";
462
+	XCTAssertTrue([button.buttonId isEqualToString:expectedButtonId]);
463
+	XCTAssertTrue([button.title isEqualToString:expectedTitle]);
464
+	XCTAssertFalse(button.enabled);
465
+
466
+	//TODO: Determine how to tests buttonColor,buttonFontSize and buttonFontWeight?
467
+}
468
+
469
+-(void)testTopBarNoBorderOn {
470
+	NSNumber* topBarNoBorderInput = @(1);
471
+	self.options.topBar.noBorder = [[Bool alloc] initWithValue:topBarNoBorderInput];
472
+	__unused RNNStackController* nav = [self createNavigationController];
473
+	[self.uut viewWillAppear:false];
474
+	XCTAssertNotNil(self.uut.navigationController.navigationBar.shadowImage);
475
+}
476
+
477
+-(void)testTopBarNoBorderOff {
478
+	NSNumber* topBarNoBorderInput = @(0);
479
+	self.options.topBar.noBorder = [[Bool alloc] initWithValue:topBarNoBorderInput];
480
+	__unused RNNStackController* nav = [self createNavigationController];
481
+	[self.uut viewWillAppear:false];
482
+	XCTAssertNil(self.uut.navigationController.navigationBar.shadowImage);
483
+}
484
+
485
+-(void)testStatusBarBlurOn {
486
+	NSNumber* statusBarBlurInput = @(1);
487
+	self.options.statusBar.blur = [[Bool alloc] initWithValue:statusBarBlurInput];
488
+	[self.uut viewWillAppear:false];
489
+	XCTAssertNotNil([self.uut.view viewWithTag:BLUR_STATUS_TAG]);
490
+}
491
+
492
+-(void)testStatusBarBlurOff {
493
+	NSNumber* statusBarBlurInput = @(0);
494
+	self.options.statusBar.blur = [[Bool alloc] initWithValue:statusBarBlurInput];
495
+	[self.uut viewWillAppear:false];
496
+	XCTAssertNil([self.uut.view viewWithTag:BLUR_STATUS_TAG]);
497
+}
498
+
499
+- (void)testTabBarHidden_default {
500
+	[self.uut viewWillAppear:false];
501
+
502
+	XCTAssertFalse([self.uut hidesBottomBarWhenPushed]);
503
+}
504
+
505
+- (void)testTabBarHidden_false {
506
+	self.options.bottomTabs.visible = [[Bool alloc] initWithValue:@(1)];
507
+	[self.uut viewWillAppear:false];
508
+
509
+	XCTAssertFalse([self.uut hidesBottomBarWhenPushed]);
510
+}
511
+
512
+-(void)testTopBarBlur_default {
513
+	__unused RNNStackController* nav = [self createNavigationController];
514
+	[self.uut viewWillAppear:false];
515
+	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
516
+}
517
+
518
+-(void)testTopBarBlur_false {
519
+	NSNumber* topBarBlurInput = @(0);
520
+	self.options.topBar.background.blur = [[Bool alloc] initWithValue:topBarBlurInput];
521
+	__unused RNNStackController* nav = [self createNavigationController];
522
+	[self.uut viewWillAppear:false];
523
+	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
524
+}
525
+
526
+-(void)testTopBarBlur_true {
527
+	NSNumber* topBarBlurInput = @(1);
528
+	self.options.topBar.background.blur = [[Bool alloc] initWithValue:topBarBlurInput];
529
+	__unused RNNStackController* nav = [self createNavigationController];
530
+	[self.uut viewWillAppear:false];
531
+	XCTAssertNotNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
532
+}
533
+
534
+-(void)testBackgroundImage {
535
+	Image* backgroundImage = [[Image alloc] initWithValue:[[UIImage alloc] init]];
536
+	self.options.backgroundImage = backgroundImage;
537
+	[self.uut viewWillAppear:false];
538
+
539
+	XCTAssertTrue([[(UIImageView*)self.uut.view.subviews[0] image] isEqual:backgroundImage.get]);
540
+}
541
+
542
+- (void)testMergeOptionsShouldCallPresenterMergeOptions {
543
+	RNNNavigationOptions* newOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
544
+    [[(id) self.uut.presenter expect] mergeOptions:newOptions resolvedOptions:self.uut.options];
545
+	[self.uut mergeOptions:newOptions];
546
+	[(id)self.uut.presenter verify];
547
+}
548
+
549
+- (void)testOverrideOptions {
550
+	RNNNavigationOptions* newOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
551
+	newOptions.topBar.background.color = [[Color alloc] initWithValue:[UIColor redColor]];
552
+	
553
+	[self.uut overrideOptions:newOptions];
554
+	XCTAssertEqual([UIColor redColor], self.uut.options.topBar.background.color.get);
555
+}
556
+
557
+#pragma mark BottomTabs
558
+
559
+
560
+- (RNNStackController *)createNavigationController {
561
+	RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[[RNNStackPresenter alloc] init] eventEmitter:nil childViewControllers:@[self.uut]];
562
+	
563
+	return nav;
564
+}
565
+
566
+@end

+ 5
- 0
playground/ios/Podfile Visa fil

@@ -49,3 +49,8 @@ target 'NavigationTests' do
49 49
   pod 'OCMock'
50 50
 end
51 51
 
52
+target 'NavigationIOS12Tests' do
53
+  all_pods
54
+  pod 'OCMock'
55
+end
56
+

+ 3
- 3
playground/ios/Podfile.lock Visa fil

@@ -220,7 +220,7 @@ PODS:
220 220
     - ReactCommon/jscallinvoker (= 0.61.4)
221 221
   - ReactNativeKeyboardTrackingView (5.6.1):
222 222
     - React
223
-  - ReactNativeNavigation (4.0.4):
223
+  - ReactNativeNavigation (4.0.6):
224 224
     - React
225 225
   - Yoga (1.14.0)
226 226
 
@@ -346,9 +346,9 @@ SPEC CHECKSUMS:
346 346
   React-RCTVibration: 0f76400ee3cec6edb9c125da49fed279340d145a
347 347
   ReactCommon: a6a294e7028ed67b926d29551aa9394fd989c24c
348 348
   ReactNativeKeyboardTrackingView: a240a6a0dba852bb107109a7ec7e98b884055977
349
-  ReactNativeNavigation: bf2951e30fb873b3ed1e736419c38ed1efe0f6c2
349
+  ReactNativeNavigation: a04159cfe472aa4d9dd48d1185b4a2539b9dbbe2
350 350
   Yoga: ba3d99dbee6c15ea6bbe3783d1f0cb1ffb79af0f
351 351
 
352
-PODFILE CHECKSUM: 8a6eee15d75935b9144e5228ce8fa2a5b98079e7
352
+PODFILE CHECKSUM: 781f49751a12b13af3e83d5dfc4b122aa5770543
353 353
 
354 354
 COCOAPODS: 1.7.1

+ 230
- 0
playground/ios/playground.xcodeproj/project.pbxproj Visa fil

@@ -13,6 +13,9 @@
13 13
 		13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14 14
 		501C86B9239FE9C400E0B631 /* UIImage+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 501C86B8239FE9C400E0B631 /* UIImage+Utils.m */; };
15 15
 		50451D35204451A900695F00 /* RNNCustomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50451D34204451A800695F00 /* RNNCustomViewController.m */; };
16
+		50996C6823AA477400008F89 /* RNNRootViewControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50996C6723AA477400008F89 /* RNNRootViewControllerTest.m */; };
17
+		50996C6923AA487800008F89 /* RNNTestRootViewCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263D2385888C003F36BA /* RNNTestRootViewCreator.m */; };
18
+		67C681D42B662A53F29C19DA /* Pods_NavigationIOS12Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEE0B5D45FD34FBABC6586CF /* Pods_NavigationIOS12Tests.framework */; };
16 19
 		9D204F3DC4FBCD81583BF99F /* Pods_playground.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A3340545EAAF11C1F146864 /* Pods_playground.framework */; };
17 20
 		E5046080227748EA00212BD8 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E504607F227748EA00212BD8 /* JavaScriptCore.framework */; };
18 21
 		E58D26462385888C003F36BA /* UIViewController+LayoutProtocolTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26252385888B003F36BA /* UIViewController+LayoutProtocolTest.m */; };
@@ -47,6 +50,13 @@
47 50
 /* End PBXBuildFile section */
48 51
 
49 52
 /* Begin PBXContainerItemProxy section */
53
+		50996C6223AA46DD00008F89 /* PBXContainerItemProxy */ = {
54
+			isa = PBXContainerItemProxy;
55
+			containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
56
+			proxyType = 1;
57
+			remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
58
+			remoteInfo = playground;
59
+		};
50 60
 		E58D2620238587F4003F36BA /* PBXContainerItemProxy */ = {
51 61
 			isa = PBXContainerItemProxy;
52 62
 			containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
@@ -66,16 +76,22 @@
66 76
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
67 77
 		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 78
 		4A3340545EAAF11C1F146864 /* Pods_playground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_playground.framework; sourceTree = BUILT_PRODUCTS_DIR; };
79
+		4AE37ACF6BFBAB211EE8E7E9 /* Pods-NavigationIOS12Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NavigationIOS12Tests.release.xcconfig"; path = "Target Support Files/Pods-NavigationIOS12Tests/Pods-NavigationIOS12Tests.release.xcconfig"; sourceTree = "<group>"; };
69 80
 		501C86B7239FE9C400E0B631 /* UIImage+Utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+Utils.h"; sourceTree = "<group>"; };
70 81
 		501C86B8239FE9C400E0B631 /* UIImage+Utils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Utils.m"; sourceTree = "<group>"; };
71 82
 		50364D69238E7ECC000E62A2 /* Pods_playground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_playground.framework; sourceTree = BUILT_PRODUCTS_DIR; };
72 83
 		50364D6B238E7F0A000E62A2 /* ReactNativeNavigation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ReactNativeNavigation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
73 84
 		50451D33204451A800695F00 /* RNNCustomViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNNCustomViewController.h; path = ../../../lib/ios/RNNCustomViewController.h; sourceTree = "<group>"; };
74 85
 		50451D34204451A800695F00 /* RNNCustomViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNNCustomViewController.m; path = ../../../lib/ios/RNNCustomViewController.m; sourceTree = "<group>"; };
86
+		50996C5D23AA46DD00008F89 /* NavigationIOS12Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NavigationIOS12Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
87
+		50996C6123AA46DD00008F89 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
88
+		50996C6723AA477400008F89 /* RNNRootViewControllerTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNRootViewControllerTest.m; sourceTree = "<group>"; };
75 89
 		7F8E255E2E08F6ECE7DF6FE3 /* Pods-playground.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground.release.xcconfig"; path = "Target Support Files/Pods-playground/Pods-playground.release.xcconfig"; sourceTree = "<group>"; };
76 90
 		84E32151E3A71C2B7328BCB4 /* Pods_NavigationTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NavigationTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
77 91
 		B484A10A046B0046B98A76B5 /* Pods-playground.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground.debug.xcconfig"; path = "Target Support Files/Pods-playground/Pods-playground.debug.xcconfig"; sourceTree = "<group>"; };
92
+		C9E7FB91365E7BEF959ADB5F /* Pods-NavigationIOS12Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NavigationIOS12Tests.debug.xcconfig"; path = "Target Support Files/Pods-NavigationIOS12Tests/Pods-NavigationIOS12Tests.debug.xcconfig"; sourceTree = "<group>"; };
78 93
 		D95A99C17C65D674BA9DF26B /* Pods-NavigationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NavigationTests.release.xcconfig"; path = "Target Support Files/Pods-NavigationTests/Pods-NavigationTests.release.xcconfig"; sourceTree = "<group>"; };
94
+		DEE0B5D45FD34FBABC6586CF /* Pods_NavigationIOS12Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NavigationIOS12Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
79 95
 		E504607F227748EA00212BD8 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
80 96
 		E58D261B238587F4003F36BA /* NavigationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NavigationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
81 97
 		E58D261F238587F4003F36BA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -122,6 +138,14 @@
122 138
 			);
123 139
 			runOnlyForDeploymentPostprocessing = 0;
124 140
 		};
141
+		50996C5A23AA46DD00008F89 /* Frameworks */ = {
142
+			isa = PBXFrameworksBuildPhase;
143
+			buildActionMask = 2147483647;
144
+			files = (
145
+				67C681D42B662A53F29C19DA /* Pods_NavigationIOS12Tests.framework in Frameworks */,
146
+			);
147
+			runOnlyForDeploymentPostprocessing = 0;
148
+		};
125 149
 		E58D2618238587F4003F36BA /* Frameworks */ = {
126 150
 			isa = PBXFrameworksBuildPhase;
127 151
 			buildActionMask = 2147483647;
@@ -155,10 +179,21 @@
155 179
 				7F8E255E2E08F6ECE7DF6FE3 /* Pods-playground.release.xcconfig */,
156 180
 				4259AF43A23D928FE78B4A3A /* Pods-NavigationTests.debug.xcconfig */,
157 181
 				D95A99C17C65D674BA9DF26B /* Pods-NavigationTests.release.xcconfig */,
182
+				C9E7FB91365E7BEF959ADB5F /* Pods-NavigationIOS12Tests.debug.xcconfig */,
183
+				4AE37ACF6BFBAB211EE8E7E9 /* Pods-NavigationIOS12Tests.release.xcconfig */,
158 184
 			);
159 185
 			path = Pods;
160 186
 			sourceTree = "<group>";
161 187
 		};
188
+		50996C5E23AA46DD00008F89 /* NavigationIOS12Tests */ = {
189
+			isa = PBXGroup;
190
+			children = (
191
+				50996C6723AA477400008F89 /* RNNRootViewControllerTest.m */,
192
+				50996C6123AA46DD00008F89 /* Info.plist */,
193
+			);
194
+			path = NavigationIOS12Tests;
195
+			sourceTree = "<group>";
196
+		};
162 197
 		832341AE1AAA6A7D00B99B32 /* Libraries */ = {
163 198
 			isa = PBXGroup;
164 199
 			children = (
@@ -172,6 +207,7 @@
172 207
 				13B07FAE1A68108700A75B9A /* playground */,
173 208
 				832341AE1AAA6A7D00B99B32 /* Libraries */,
174 209
 				E58D261C238587F4003F36BA /* NavigationTests */,
210
+				50996C5E23AA46DD00008F89 /* NavigationIOS12Tests */,
175 211
 				83CBBA001A601CBA00E9B192 /* Products */,
176 212
 				E504607E227748E900212BD8 /* Frameworks */,
177 213
 				4620213833CA57C55B227B23 /* Pods */,
@@ -186,6 +222,7 @@
186 222
 			children = (
187 223
 				13B07F961A680F5B00A75B9A /* playground.app */,
188 224
 				E58D261B238587F4003F36BA /* NavigationTests.xctest */,
225
+				50996C5D23AA46DD00008F89 /* NavigationIOS12Tests.xctest */,
189 226
 			);
190 227
 			name = Products;
191 228
 			sourceTree = "<group>";
@@ -198,6 +235,7 @@
198 235
 				E504607F227748EA00212BD8 /* JavaScriptCore.framework */,
199 236
 				4A3340545EAAF11C1F146864 /* Pods_playground.framework */,
200 237
 				84E32151E3A71C2B7328BCB4 /* Pods_NavigationTests.framework */,
238
+				DEE0B5D45FD34FBABC6586CF /* Pods_NavigationIOS12Tests.framework */,
201 239
 			);
202 240
 			name = Frameworks;
203 241
 			sourceTree = "<group>";
@@ -281,6 +319,26 @@
281 319
 			productReference = 13B07F961A680F5B00A75B9A /* playground.app */;
282 320
 			productType = "com.apple.product-type.application";
283 321
 		};
322
+		50996C5C23AA46DD00008F89 /* NavigationIOS12Tests */ = {
323
+			isa = PBXNativeTarget;
324
+			buildConfigurationList = 50996C6623AA46DD00008F89 /* Build configuration list for PBXNativeTarget "NavigationIOS12Tests" */;
325
+			buildPhases = (
326
+				0F3F01851F0684D870017CA2 /* [CP] Check Pods Manifest.lock */,
327
+				50996C5923AA46DD00008F89 /* Sources */,
328
+				50996C5A23AA46DD00008F89 /* Frameworks */,
329
+				50996C5B23AA46DD00008F89 /* Resources */,
330
+				CAB9D527AC9F72232C0702DB /* [CP] Embed Pods Frameworks */,
331
+			);
332
+			buildRules = (
333
+			);
334
+			dependencies = (
335
+				50996C6323AA46DD00008F89 /* PBXTargetDependency */,
336
+			);
337
+			name = NavigationIOS12Tests;
338
+			productName = NavigationIOS12Tests;
339
+			productReference = 50996C5D23AA46DD00008F89 /* NavigationIOS12Tests.xctest */;
340
+			productType = "com.apple.product-type.bundle.unit-test";
341
+		};
284 342
 		E58D261A238587F4003F36BA /* NavigationTests */ = {
285 343
 			isa = PBXNativeTarget;
286 344
 			buildConfigurationList = E58D2624238587F4003F36BA /* Build configuration list for PBXNativeTarget "NavigationTests" */;
@@ -307,12 +365,17 @@
307 365
 		83CBB9F71A601CBA00E9B192 /* Project object */ = {
308 366
 			isa = PBXProject;
309 367
 			attributes = {
368
+				DefaultBuildSystemTypeForWorkspace = Original;
310 369
 				LastUpgradeCheck = 1120;
311 370
 				ORGANIZATIONNAME = Wix;
312 371
 				TargetAttributes = {
313 372
 					13B07F861A680F5B00A75B9A = {
314 373
 						ProvisioningStyle = Manual;
315 374
 					};
375
+					50996C5C23AA46DD00008F89 = {
376
+						CreatedOnToolsVersion = 11.2.1;
377
+						ProvisioningStyle = Automatic;
378
+					};
316 379
 					E58D261A238587F4003F36BA = {
317 380
 						CreatedOnToolsVersion = 11.2.1;
318 381
 						DevelopmentTeam = S3GLW74Y8N;
@@ -336,6 +399,7 @@
336 399
 			targets = (
337 400
 				13B07F861A680F5B00A75B9A /* playground */,
338 401
 				E58D261A238587F4003F36BA /* NavigationTests */,
402
+				50996C5C23AA46DD00008F89 /* NavigationIOS12Tests */,
339 403
 			);
340 404
 		};
341 405
 /* End PBXProject section */
@@ -350,6 +414,13 @@
350 414
 			);
351 415
 			runOnlyForDeploymentPostprocessing = 0;
352 416
 		};
417
+		50996C5B23AA46DD00008F89 /* Resources */ = {
418
+			isa = PBXResourcesBuildPhase;
419
+			buildActionMask = 2147483647;
420
+			files = (
421
+			);
422
+			runOnlyForDeploymentPostprocessing = 0;
423
+		};
353 424
 		E58D2619238587F4003F36BA /* Resources */ = {
354 425
 			isa = PBXResourcesBuildPhase;
355 426
 			buildActionMask = 2147483647;
@@ -374,6 +445,28 @@
374 445
 			shellPath = /bin/sh;
375 446
 			shellScript = "export NODE_BINARY=node\n../../node_modules/react-native/scripts/react-native-xcode.sh ./index.js\n";
376 447
 		};
448
+		0F3F01851F0684D870017CA2 /* [CP] Check Pods Manifest.lock */ = {
449
+			isa = PBXShellScriptBuildPhase;
450
+			buildActionMask = 2147483647;
451
+			files = (
452
+			);
453
+			inputFileListPaths = (
454
+			);
455
+			inputPaths = (
456
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
457
+				"${PODS_ROOT}/Manifest.lock",
458
+			);
459
+			name = "[CP] Check Pods Manifest.lock";
460
+			outputFileListPaths = (
461
+			);
462
+			outputPaths = (
463
+				"$(DERIVED_FILE_DIR)/Pods-NavigationIOS12Tests-checkManifestLockResult.txt",
464
+			);
465
+			runOnlyForDeploymentPostprocessing = 0;
466
+			shellPath = /bin/sh;
467
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
468
+			showEnvVarsInLog = 0;
469
+		};
377 470
 		7019F906475029978A0A826C /* [CP] Check Pods Manifest.lock */ = {
378 471
 			isa = PBXShellScriptBuildPhase;
379 472
 			buildActionMask = 2147483647;
@@ -526,6 +619,72 @@
526 619
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-playground/Pods-playground-frameworks.sh\"\n";
527 620
 			showEnvVarsInLog = 0;
528 621
 		};
622
+		CAB9D527AC9F72232C0702DB /* [CP] Embed Pods Frameworks */ = {
623
+			isa = PBXShellScriptBuildPhase;
624
+			buildActionMask = 2147483647;
625
+			files = (
626
+			);
627
+			inputPaths = (
628
+				"${PODS_ROOT}/Target Support Files/Pods-NavigationIOS12Tests/Pods-NavigationIOS12Tests-frameworks.sh",
629
+				"${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework",
630
+				"${BUILT_PRODUCTS_DIR}/FBReactNativeSpec/FBReactNativeSpec.framework",
631
+				"${BUILT_PRODUCTS_DIR}/Folly/folly.framework",
632
+				"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
633
+				"${BUILT_PRODUCTS_DIR}/React-Core/React.framework",
634
+				"${BUILT_PRODUCTS_DIR}/React-CoreModules/CoreModules.framework",
635
+				"${BUILT_PRODUCTS_DIR}/React-RCTActionSheet/RCTActionSheet.framework",
636
+				"${BUILT_PRODUCTS_DIR}/React-RCTAnimation/RCTAnimation.framework",
637
+				"${BUILT_PRODUCTS_DIR}/React-RCTBlob/RCTBlob.framework",
638
+				"${BUILT_PRODUCTS_DIR}/React-RCTImage/RCTImage.framework",
639
+				"${BUILT_PRODUCTS_DIR}/React-RCTLinking/RCTLinking.framework",
640
+				"${BUILT_PRODUCTS_DIR}/React-RCTNetwork/RCTNetwork.framework",
641
+				"${BUILT_PRODUCTS_DIR}/React-RCTSettings/RCTSettings.framework",
642
+				"${BUILT_PRODUCTS_DIR}/React-RCTText/RCTText.framework",
643
+				"${BUILT_PRODUCTS_DIR}/React-RCTVibration/RCTVibration.framework",
644
+				"${BUILT_PRODUCTS_DIR}/React-cxxreact/cxxreact.framework",
645
+				"${BUILT_PRODUCTS_DIR}/React-jsi/jsi.framework",
646
+				"${BUILT_PRODUCTS_DIR}/React-jsiexecutor/jsireact.framework",
647
+				"${BUILT_PRODUCTS_DIR}/React-jsinspector/jsinspector.framework",
648
+				"${BUILT_PRODUCTS_DIR}/ReactCommon/ReactCommon.framework",
649
+				"${BUILT_PRODUCTS_DIR}/ReactNativeKeyboardTrackingView/ReactNativeKeyboardTrackingView.framework",
650
+				"${BUILT_PRODUCTS_DIR}/ReactNativeNavigation/ReactNativeNavigation.framework",
651
+				"${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework",
652
+				"${BUILT_PRODUCTS_DIR}/glog/glog.framework",
653
+				"${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework",
654
+			);
655
+			name = "[CP] Embed Pods Frameworks";
656
+			outputPaths = (
657
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework",
658
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBReactNativeSpec.framework",
659
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework",
660
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
661
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework",
662
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CoreModules.framework",
663
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTActionSheet.framework",
664
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTAnimation.framework",
665
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTBlob.framework",
666
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTImage.framework",
667
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTLinking.framework",
668
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTNetwork.framework",
669
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTSettings.framework",
670
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTText.framework",
671
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTVibration.framework",
672
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/cxxreact.framework",
673
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsi.framework",
674
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsireact.framework",
675
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsinspector.framework",
676
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactCommon.framework",
677
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeKeyboardTrackingView.framework",
678
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeNavigation.framework",
679
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework",
680
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
681
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OCMock.framework",
682
+			);
683
+			runOnlyForDeploymentPostprocessing = 0;
684
+			shellPath = /bin/sh;
685
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NavigationIOS12Tests/Pods-NavigationIOS12Tests-frameworks.sh\"\n";
686
+			showEnvVarsInLog = 0;
687
+		};
529 688
 		D80DD80E880A67F5575078C4 /* [CP] Check Pods Manifest.lock */ = {
530 689
 			isa = PBXShellScriptBuildPhase;
531 690
 			buildActionMask = 2147483647;
@@ -561,6 +720,15 @@
561 720
 			);
562 721
 			runOnlyForDeploymentPostprocessing = 0;
563 722
 		};
723
+		50996C5923AA46DD00008F89 /* Sources */ = {
724
+			isa = PBXSourcesBuildPhase;
725
+			buildActionMask = 2147483647;
726
+			files = (
727
+				50996C6923AA487800008F89 /* RNNTestRootViewCreator.m in Sources */,
728
+				50996C6823AA477400008F89 /* RNNRootViewControllerTest.m in Sources */,
729
+			);
730
+			runOnlyForDeploymentPostprocessing = 0;
731
+		};
564 732
 		E58D2617238587F4003F36BA /* Sources */ = {
565 733
 			isa = PBXSourcesBuildPhase;
566 734
 			buildActionMask = 2147483647;
@@ -599,6 +767,11 @@
599 767
 /* End PBXSourcesBuildPhase section */
600 768
 
601 769
 /* Begin PBXTargetDependency section */
770
+		50996C6323AA46DD00008F89 /* PBXTargetDependency */ = {
771
+			isa = PBXTargetDependency;
772
+			target = 13B07F861A680F5B00A75B9A /* playground */;
773
+			targetProxy = 50996C6223AA46DD00008F89 /* PBXContainerItemProxy */;
774
+		};
602 775
 		E58D2621238587F4003F36BA /* PBXTargetDependency */ = {
603 776
 			isa = PBXTargetDependency;
604 777
 			target = 13B07F861A680F5B00A75B9A /* playground */;
@@ -663,6 +836,54 @@
663 836
 			};
664 837
 			name = Release;
665 838
 		};
839
+		50996C6423AA46DD00008F89 /* Debug */ = {
840
+			isa = XCBuildConfiguration;
841
+			baseConfigurationReference = C9E7FB91365E7BEF959ADB5F /* Pods-NavigationIOS12Tests.debug.xcconfig */;
842
+			buildSettings = {
843
+				CLANG_ANALYZER_NONNULL = YES;
844
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
845
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
846
+				CLANG_ENABLE_OBJC_WEAK = YES;
847
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
848
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
849
+				CODE_SIGN_STYLE = Automatic;
850
+				DEBUG_INFORMATION_FORMAT = dwarf;
851
+				GCC_C_LANGUAGE_STANDARD = gnu11;
852
+				INFOPLIST_FILE = NavigationIOS12Tests/Info.plist;
853
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
854
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
855
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
856
+				MTL_FAST_MATH = YES;
857
+				PRODUCT_BUNDLE_IDENTIFIER = rn.NavigationIOS12Tests;
858
+				PRODUCT_NAME = "$(TARGET_NAME)";
859
+				TARGETED_DEVICE_FAMILY = "1,2";
860
+			};
861
+			name = Debug;
862
+		};
863
+		50996C6523AA46DD00008F89 /* Release */ = {
864
+			isa = XCBuildConfiguration;
865
+			baseConfigurationReference = 4AE37ACF6BFBAB211EE8E7E9 /* Pods-NavigationIOS12Tests.release.xcconfig */;
866
+			buildSettings = {
867
+				CLANG_ANALYZER_NONNULL = YES;
868
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
869
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
870
+				CLANG_ENABLE_OBJC_WEAK = YES;
871
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
872
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
873
+				CODE_SIGN_STYLE = Automatic;
874
+				COPY_PHASE_STRIP = NO;
875
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
876
+				GCC_C_LANGUAGE_STANDARD = gnu11;
877
+				INFOPLIST_FILE = NavigationIOS12Tests/Info.plist;
878
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
879
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
880
+				MTL_FAST_MATH = YES;
881
+				PRODUCT_BUNDLE_IDENTIFIER = rn.NavigationIOS12Tests;
882
+				PRODUCT_NAME = "$(TARGET_NAME)";
883
+				TARGETED_DEVICE_FAMILY = "1,2";
884
+			};
885
+			name = Release;
886
+		};
666 887
 		83CBBA201A601CBA00E9B192 /* Debug */ = {
667 888
 			isa = XCBuildConfiguration;
668 889
 			buildSettings = {
@@ -828,6 +1049,15 @@
828 1049
 			defaultConfigurationIsVisible = 0;
829 1050
 			defaultConfigurationName = Debug;
830 1051
 		};
1052
+		50996C6623AA46DD00008F89 /* Build configuration list for PBXNativeTarget "NavigationIOS12Tests" */ = {
1053
+			isa = XCConfigurationList;
1054
+			buildConfigurations = (
1055
+				50996C6423AA46DD00008F89 /* Debug */,
1056
+				50996C6523AA46DD00008F89 /* Release */,
1057
+			);
1058
+			defaultConfigurationIsVisible = 0;
1059
+			defaultConfigurationName = Debug;
1060
+		};
831 1061
 		83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "playground" */ = {
832 1062
 			isa = XCConfigurationList;
833 1063
 			buildConfigurations = (

+ 88
- 0
playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playgroundIOS12.xcscheme Visa fil

@@ -0,0 +1,88 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "1120"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "YES"
7
+      buildImplicitDependencies = "YES">
8
+      <BuildActionEntries>
9
+         <BuildActionEntry
10
+            buildForTesting = "YES"
11
+            buildForRunning = "YES"
12
+            buildForProfiling = "YES"
13
+            buildForArchiving = "YES"
14
+            buildForAnalyzing = "YES">
15
+            <BuildableReference
16
+               BuildableIdentifier = "primary"
17
+               BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18
+               BuildableName = "playground.app"
19
+               BlueprintName = "playground"
20
+               ReferencedContainer = "container:playground.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+      </BuildActionEntries>
24
+   </BuildAction>
25
+   <TestAction
26
+      buildConfiguration = "Debug"
27
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+      shouldUseLaunchSchemeArgsEnv = "YES">
30
+      <Testables>
31
+         <TestableReference
32
+            skipped = "NO">
33
+            <BuildableReference
34
+               BuildableIdentifier = "primary"
35
+               BlueprintIdentifier = "50996C5C23AA46DD00008F89"
36
+               BuildableName = "NavigationIOS12Tests.xctest"
37
+               BlueprintName = "NavigationIOS12Tests"
38
+               ReferencedContainer = "container:playground.xcodeproj">
39
+            </BuildableReference>
40
+         </TestableReference>
41
+      </Testables>
42
+   </TestAction>
43
+   <LaunchAction
44
+      buildConfiguration = "Debug"
45
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47
+      launchStyle = "0"
48
+      useCustomWorkingDirectory = "NO"
49
+      ignoresPersistentStateOnLaunch = "NO"
50
+      debugDocumentVersioning = "YES"
51
+      debugServiceExtension = "internal"
52
+      allowLocationSimulation = "YES">
53
+      <BuildableProductRunnable
54
+         runnableDebuggingMode = "0">
55
+         <BuildableReference
56
+            BuildableIdentifier = "primary"
57
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
58
+            BuildableName = "playground.app"
59
+            BlueprintName = "playground"
60
+            ReferencedContainer = "container:playground.xcodeproj">
61
+         </BuildableReference>
62
+      </BuildableProductRunnable>
63
+   </LaunchAction>
64
+   <ProfileAction
65
+      buildConfiguration = "Release"
66
+      shouldUseLaunchSchemeArgsEnv = "YES"
67
+      savedToolIdentifier = ""
68
+      useCustomWorkingDirectory = "NO"
69
+      debugDocumentVersioning = "YES">
70
+      <BuildableProductRunnable
71
+         runnableDebuggingMode = "0">
72
+         <BuildableReference
73
+            BuildableIdentifier = "primary"
74
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
75
+            BuildableName = "playground.app"
76
+            BlueprintName = "playground"
77
+            ReferencedContainer = "container:playground.xcodeproj">
78
+         </BuildableReference>
79
+      </BuildableProductRunnable>
80
+   </ProfileAction>
81
+   <AnalyzeAction
82
+      buildConfiguration = "Debug">
83
+   </AnalyzeAction>
84
+   <ArchiveAction
85
+      buildConfiguration = "Release"
86
+      revealArchiveInOrganizer = "YES">
87
+   </ArchiveAction>
88
+</Scheme>

+ 25
- 21
scripts/test-unit.js Visa fil

@@ -23,32 +23,36 @@ function runAndroidUnitTests() {
23 23
 }
24 24
 
25 25
 function runIosUnitTests() {
26
-  const conf = release ? `Release` : `Debug`;
27
-
28 26
   exec.execSync('npm run build');
29 27
   exec.execSync('npm run pod-install');
28
+  testTarget('playground', 'iPhone 11');
29
+  testTarget('playgroundIOS12', 'iPhone X', '12.2');
30
+}
31
+
32
+function testTarget(scheme, device, OS = 'latest') {
33
+  const conf = release ? `Release` : `Debug`;
30 34
   exec.execSync(`cd ./playground/ios &&
31
-            RCT_NO_LAUNCH_PACKAGER=true
32
-            xcodebuild build build-for-testing
33
-            -scheme "playground"
34
-            -workspace playground.xcworkspace
35
-            -sdk iphonesimulator
36
-            -configuration ${conf}
37
-            -derivedDataPath ./DerivedData/playground
38
-            -quiet
39
-            -UseModernBuildSystem=NO
40
-            ONLY_ACTIVE_ARCH=YES`);
35
+  RCT_NO_LAUNCH_PACKAGER=true
36
+  xcodebuild build build-for-testing
37
+  -scheme "${scheme}"
38
+  -workspace playground.xcworkspace
39
+  -sdk iphonesimulator
40
+  -configuration ${conf}
41
+  -derivedDataPath ./DerivedData/playground
42
+  -quiet
43
+  -UseModernBuildSystem=NO
44
+  ONLY_ACTIVE_ARCH=YES`);
41 45
 
42 46
   exec.execSync(`cd ./playground/ios &&
43
-            RCT_NO_LAUNCH_PACKAGER=true
44
-            xcodebuild test-without-building
45
-            -scheme "playground"
46
-            -workspace playground.xcworkspace
47
-            -sdk iphonesimulator
48
-            -configuration ${conf}
49
-            -destination 'platform=iOS Simulator,name=iPhone 11'
50
-            -derivedDataPath ./DerivedData/playground
51
-            ONLY_ACTIVE_ARCH=YES`);
47
+  RCT_NO_LAUNCH_PACKAGER=true
48
+  xcodebuild test-without-building
49
+  -scheme "${scheme}"
50
+  -workspace playground.xcworkspace
51
+  -sdk iphonesimulator
52
+  -configuration ${conf}
53
+  -destination 'platform=iOS Simulator,name=${device},OS=${OS}'
54
+  -derivedDataPath ./DerivedData/playground
55
+  ONLY_ACTIVE_ARCH=YES`);
52 56
 }
53 57
 
54 58
 run();