|
@@ -7,6 +7,8 @@
|
7
|
7
|
#import "RCCManager.h"
|
8
|
8
|
#import "RCTConvert.h"
|
9
|
9
|
#import "RCCExternalViewControllerProtocol.h"
|
|
10
|
+#import "RCTHelpers.h"
|
|
11
|
+#import "RCCTitleViewHelper.h"
|
10
|
12
|
|
11
|
13
|
NSString* const RCCViewControllerCancelReactTouchesNotification = @"RCCViewControllerCancelReactTouchesNotification";
|
12
|
14
|
|
|
@@ -189,138 +191,164 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
|
189
|
191
|
// we want to reset the style to what we expect (so we need to reset on every willAppear)
|
190
|
192
|
- (void)setStyleOnAppear
|
191
|
193
|
{
|
192
|
|
- [self setStyleOnAppearForViewController:self];
|
|
194
|
+ [self setStyleOnAppearForViewController:self appeared:false];
|
193
|
195
|
}
|
194
|
196
|
|
195
|
|
--(void)setStyleOnAppearForViewController:(UIViewController*)viewController
|
|
197
|
+- (void)updateStyle
|
196
|
198
|
{
|
|
199
|
+ [self setStyleOnAppearForViewController:self appeared:true];
|
|
200
|
+}
|
|
201
|
+
|
|
202
|
+-(void)setStyleOnAppearForViewController:(UIViewController*)viewController appeared:(BOOL)appeared
|
|
203
|
+{
|
|
204
|
+
|
197
|
205
|
NSString *screenBackgroundColor = self.navigatorStyle[@"screenBackgroundColor"];
|
198
|
|
- if (screenBackgroundColor)
|
199
|
|
- {
|
|
206
|
+ if (screenBackgroundColor) {
|
|
207
|
+
|
200
|
208
|
UIColor *color = screenBackgroundColor != (id)[NSNull null] ? [RCTConvert UIColor:screenBackgroundColor] : nil;
|
201
|
|
- self.view.backgroundColor = color;
|
|
209
|
+ viewController.view.backgroundColor = color;
|
202
|
210
|
}
|
203
|
211
|
|
204
|
212
|
NSString *navBarBackgroundColor = self.navigatorStyle[@"navBarBackgroundColor"];
|
205
|
|
- if (navBarBackgroundColor)
|
206
|
|
- {
|
|
213
|
+ if (navBarBackgroundColor) {
|
|
214
|
+
|
207
|
215
|
UIColor *color = navBarBackgroundColor != (id)[NSNull null] ? [RCTConvert UIColor:navBarBackgroundColor] : nil;
|
208
|
216
|
viewController.navigationController.navigationBar.barTintColor = color;
|
209
|
|
- }
|
210
|
|
- else
|
211
|
|
- {
|
|
217
|
+
|
|
218
|
+ } else {
|
212
|
219
|
viewController.navigationController.navigationBar.barTintColor = nil;
|
213
|
220
|
}
|
214
|
|
-
|
215
|
|
- NSString *navBarTextColor = self.navigatorStyle[@"navBarTextColor"];
|
216
|
|
- if (navBarTextColor)
|
217
|
|
- {
|
218
|
|
- UIColor *color = navBarTextColor != (id)[NSNull null] ? [RCTConvert UIColor:navBarTextColor] : nil;
|
219
|
|
- [viewController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : color}];
|
|
221
|
+
|
|
222
|
+ NSMutableDictionary *titleTextAttributes = [RCTHelpers textAttributesFromDictionary:self.navigatorStyle withPrefix:@"navBarText" baseFont:[UIFont boldSystemFontOfSize:17]];
|
|
223
|
+ [self.navigationController.navigationBar setTitleTextAttributes:titleTextAttributes];
|
|
224
|
+
|
|
225
|
+ if (self.navigationItem.titleView && [self.navigationItem.titleView isKindOfClass:[RCCTitleView class]]) {
|
|
226
|
+
|
|
227
|
+ RCCTitleView *titleView = (RCCTitleView *)self.navigationItem.titleView;
|
|
228
|
+ RCCTitleViewHelper *helper = [[RCCTitleViewHelper alloc] init:viewController navigationController:viewController.navigationController title:titleView.titleLabel.text subtitle:titleView.subtitleLabel.text titleImageData:nil];
|
|
229
|
+ [helper setup:self.navigatorStyle];
|
220
|
230
|
}
|
221
|
|
- else
|
222
|
|
- {
|
223
|
|
- [viewController.navigationController.navigationBar setTitleTextAttributes:nil];
|
|
231
|
+
|
|
232
|
+ NSMutableDictionary *navButtonTextAttributes = [RCTHelpers textAttributesFromDictionary:self.navigatorStyle withPrefix:@"navBarButton"];
|
|
233
|
+
|
|
234
|
+ if (navButtonTextAttributes.allKeys.count > 0) {
|
|
235
|
+
|
|
236
|
+ for (UIBarButtonItem *item in viewController.navigationItem.leftBarButtonItems) {
|
|
237
|
+ [item setTitleTextAttributes:navButtonTextAttributes forState:UIControlStateNormal];
|
|
238
|
+ }
|
|
239
|
+
|
|
240
|
+ for (UIBarButtonItem *item in viewController.navigationItem.rightBarButtonItems) {
|
|
241
|
+ [item setTitleTextAttributes:navButtonTextAttributes forState:UIControlStateNormal];
|
|
242
|
+ }
|
|
243
|
+
|
|
244
|
+ // At the moment, this seems to be the only thing that gets the back button correctly
|
|
245
|
+ [navButtonTextAttributes removeObjectForKey:NSForegroundColorAttributeName];
|
|
246
|
+ [[UIBarButtonItem appearance] setTitleTextAttributes:navButtonTextAttributes forState:UIControlStateNormal];
|
|
247
|
+ // [viewController.navigationItem.backBarButtonItem setTitleTextAttributes:navButtonTextAttributes forState:UIControlStateNormal];
|
224
|
248
|
}
|
225
|
|
-
|
|
249
|
+
|
226
|
250
|
NSString *navBarButtonColor = self.navigatorStyle[@"navBarButtonColor"];
|
227
|
|
- if (navBarButtonColor)
|
228
|
|
- {
|
|
251
|
+ if (navBarButtonColor) {
|
|
252
|
+
|
229
|
253
|
UIColor *color = navBarButtonColor != (id)[NSNull null] ? [RCTConvert UIColor:navBarButtonColor] : nil;
|
230
|
254
|
viewController.navigationController.navigationBar.tintColor = color;
|
231
|
|
- }
|
232
|
|
- else
|
|
255
|
+
|
|
256
|
+ } else
|
233
|
257
|
{
|
234
|
258
|
viewController.navigationController.navigationBar.tintColor = nil;
|
235
|
259
|
}
|
236
|
260
|
|
237
|
|
- NSString *statusBarTextColorSchemeSingleScreen = self.navigatorStyle[@"statusBarTextColorSchemeSingleScreen"];
|
238
|
|
- if (statusBarTextColorSchemeSingleScreen && [statusBarTextColorSchemeSingleScreen isEqualToString:@"light"])
|
239
|
|
- {
|
240
|
|
- self._statusBarTextColorSchemeLight = YES;
|
241
|
|
- }
|
242
|
|
- else
|
243
|
|
- {
|
244
|
|
- self._statusBarTextColorSchemeLight = NO;
|
|
261
|
+ BOOL viewControllerBasedStatusBar = false;
|
|
262
|
+
|
|
263
|
+ NSObject *viewControllerBasedStatusBarAppearance = [[NSBundle mainBundle] infoDictionary][@"UIViewControllerBasedStatusBarAppearance"];
|
|
264
|
+ if (viewControllerBasedStatusBarAppearance && [viewControllerBasedStatusBarAppearance isKindOfClass:[NSNumber class]]) {
|
|
265
|
+ viewControllerBasedStatusBar = [(NSNumber *)viewControllerBasedStatusBarAppearance boolValue];
|
245
|
266
|
}
|
246
|
267
|
|
247
|
|
- // incase statusBarTextColorSchemeSingleScreen exists ignore the statusBarTextColorScheme which more globaly
|
248
|
|
- if (!statusBarTextColorSchemeSingleScreen) {
|
249
|
|
- NSString *statusBarTextColorScheme = self.navigatorStyle[@"statusBarTextColorScheme"];
|
250
|
|
- if (statusBarTextColorScheme && [statusBarTextColorScheme isEqualToString:@"light"] && !statusBarTextColorSchemeSingleScreen)
|
251
|
|
- {
|
252
|
|
- viewController.navigationController.navigationBar.barStyle = UIBarStyleBlack;
|
253
|
|
- self._statusBarTextColorSchemeLight = YES;
|
|
268
|
+ NSString *statusBarTextColorSchemeSingleScreen = self.navigatorStyle[@"statusBarTextColorSchemeSingleScreen"];
|
|
269
|
+ NSString *statusBarTextColorScheme = self.navigatorStyle[@"statusBarTextColorScheme"];
|
|
270
|
+ NSString *finalColorScheme = statusBarTextColorSchemeSingleScreen ? : statusBarTextColorScheme;
|
|
271
|
+
|
|
272
|
+ if (finalColorScheme && [finalColorScheme isEqualToString:@"light"]) {
|
|
273
|
+
|
|
274
|
+ if (!statusBarTextColorSchemeSingleScreen) {
|
|
275
|
+ viewController.navigationController.navigationBar.barStyle = UIBarStyleBlack;
|
|
276
|
+ }
|
|
277
|
+
|
|
278
|
+ self._statusBarTextColorSchemeLight = true;
|
|
279
|
+ if (!viewControllerBasedStatusBarAppearance) {
|
|
280
|
+ [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
|
|
281
|
+ }
|
|
282
|
+
|
|
283
|
+ [viewController setNeedsStatusBarAppearanceUpdate];
|
|
284
|
+
|
|
285
|
+ } else {
|
254
|
286
|
|
255
|
|
- }
|
256
|
|
- else
|
257
|
|
- {
|
258
|
|
- viewController.navigationController.navigationBar.barStyle = UIBarStyleDefault;
|
259
|
|
- self._statusBarTextColorSchemeLight = NO;
|
260
|
|
- }
|
|
287
|
+ if (!statusBarTextColorSchemeSingleScreen) {
|
|
288
|
+ viewController.navigationController.navigationBar.barStyle = UIBarStyleDefault;
|
|
289
|
+ }
|
|
290
|
+
|
|
291
|
+ self._statusBarTextColorSchemeLight = false;
|
|
292
|
+
|
|
293
|
+ if (!viewControllerBasedStatusBarAppearance) {
|
|
294
|
+ [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
|
|
295
|
+ }
|
|
296
|
+ [viewController setNeedsStatusBarAppearanceUpdate];
|
261
|
297
|
}
|
262
|
298
|
|
263
|
299
|
NSNumber *navBarHidden = self.navigatorStyle[@"navBarHidden"];
|
264
|
300
|
BOOL navBarHiddenBool = navBarHidden ? [navBarHidden boolValue] : NO;
|
265
|
|
- if (viewController.navigationController.navigationBarHidden != navBarHiddenBool)
|
266
|
|
- {
|
|
301
|
+ if (viewController.navigationController.navigationBarHidden != navBarHiddenBool) {
|
267
|
302
|
[viewController.navigationController setNavigationBarHidden:navBarHiddenBool animated:YES];
|
268
|
303
|
}
|
269
|
|
-
|
|
304
|
+
|
270
|
305
|
NSNumber *navBarHideOnScroll = self.navigatorStyle[@"navBarHideOnScroll"];
|
271
|
306
|
BOOL navBarHideOnScrollBool = navBarHideOnScroll ? [navBarHideOnScroll boolValue] : NO;
|
272
|
|
- if (navBarHideOnScrollBool)
|
273
|
|
- {
|
|
307
|
+ if (navBarHideOnScrollBool) {
|
274
|
308
|
viewController.navigationController.hidesBarsOnSwipe = YES;
|
275
|
|
- }
|
276
|
|
- else
|
277
|
|
- {
|
|
309
|
+ } else {
|
278
|
310
|
viewController.navigationController.hidesBarsOnSwipe = NO;
|
279
|
311
|
}
|
280
|
|
-
|
|
312
|
+
|
281
|
313
|
NSNumber *statusBarBlur = self.navigatorStyle[@"statusBarBlur"];
|
282
|
314
|
BOOL statusBarBlurBool = statusBarBlur ? [statusBarBlur boolValue] : NO;
|
283
|
|
- if (statusBarBlurBool)
|
284
|
|
- {
|
285
|
|
- if (![viewController.view viewWithTag:BLUR_STATUS_TAG])
|
286
|
|
- {
|
287
|
|
- UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
|
288
|
|
- blur.frame = [[UIApplication sharedApplication] statusBarFrame];
|
289
|
|
- blur.tag = BLUR_STATUS_TAG;
|
290
|
|
- [viewController.view addSubview:blur];
|
291
|
|
- }
|
|
315
|
+ if (statusBarBlurBool && ![viewController.view viewWithTag:BLUR_STATUS_TAG]) {
|
|
316
|
+
|
|
317
|
+ UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
|
|
318
|
+ blur.frame = [[UIApplication sharedApplication] statusBarFrame];
|
|
319
|
+ blur.tag = BLUR_STATUS_TAG;
|
|
320
|
+ [viewController.view insertSubview:blur atIndex:0];
|
292
|
321
|
}
|
293
|
|
-
|
|
322
|
+
|
294
|
323
|
NSNumber *navBarBlur = self.navigatorStyle[@"navBarBlur"];
|
295
|
324
|
BOOL navBarBlurBool = navBarBlur ? [navBarBlur boolValue] : NO;
|
296
|
|
- if (navBarBlurBool)
|
297
|
|
- {
|
298
|
|
- if (![viewController.navigationController.navigationBar viewWithTag:BLUR_NAVBAR_TAG])
|
299
|
|
- {
|
|
325
|
+ if (navBarBlurBool) {
|
|
326
|
+
|
|
327
|
+ if (![viewController.navigationController.navigationBar viewWithTag:BLUR_NAVBAR_TAG]) {
|
300
|
328
|
[self storeOriginalNavBarImages];
|
301
|
|
-
|
302
|
|
- [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
303
|
|
- self.navigationController.navigationBar.shadowImage = [UIImage new];
|
|
329
|
+
|
|
330
|
+ [viewController.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
|
331
|
+ viewController.navigationController.navigationBar.shadowImage = [UIImage new];
|
304
|
332
|
UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
|
305
|
333
|
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
|
306
|
|
- blur.frame = CGRectMake(0, -1 * statusBarFrame.size.height, self.navigationController.navigationBar.frame.size.width, self.navigationController.navigationBar.frame.size.height + statusBarFrame.size.height);
|
|
334
|
+ blur.frame = CGRectMake(0, -1 * statusBarFrame.size.height, viewController.navigationController.navigationBar.frame.size.width, viewController.navigationController.navigationBar.frame.size.height + statusBarFrame.size.height);
|
307
|
335
|
blur.userInteractionEnabled = NO;
|
308
|
336
|
blur.tag = BLUR_NAVBAR_TAG;
|
309
|
|
- [self.navigationController.navigationBar insertSubview:blur atIndex:0];
|
|
337
|
+ [viewController.navigationController.navigationBar insertSubview:blur atIndex:0];
|
|
338
|
+ [viewController.navigationController.navigationBar sendSubviewToBack:blur];
|
310
|
339
|
}
|
311
|
|
- }
|
312
|
|
- else
|
313
|
|
- {
|
|
340
|
+
|
|
341
|
+ } else {
|
|
342
|
+
|
314
|
343
|
UIView *blur = [viewController.navigationController.navigationBar viewWithTag:BLUR_NAVBAR_TAG];
|
315
|
|
- if (blur)
|
316
|
|
- {
|
|
344
|
+ if (blur) {
|
317
|
345
|
[blur removeFromSuperview];
|
318
|
346
|
[viewController.navigationController.navigationBar setBackgroundImage:self.originalNavBarImages[@"bgImage"] forBarMetrics:UIBarMetricsDefault];
|
319
|
347
|
viewController.navigationController.navigationBar.shadowImage = self.originalNavBarImages[@"shadowImage"];
|
320
|
348
|
self.originalNavBarImages = nil;
|
321
|
349
|
}
|
322
|
350
|
}
|
323
|
|
-
|
|
351
|
+
|
324
|
352
|
NSNumber *navBarTransparent = self.navigatorStyle[@"navBarTransparent"];
|
325
|
353
|
BOOL navBarTransparentBool = navBarTransparent ? [navBarTransparent boolValue] : NO;
|
326
|
354
|
|
|
@@ -362,48 +390,44 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
|
362
|
390
|
backgroundView.alpha = originalAlpha;
|
363
|
391
|
}];
|
364
|
392
|
}
|
365
|
|
-
|
|
393
|
+
|
|
394
|
+ NSNumber *autoAdjustsScrollViewInsets = self.navigatorStyle[@"autoAdjustScrollViewInsets"];
|
|
395
|
+ viewController.automaticallyAdjustsScrollViewInsets = autoAdjustsScrollViewInsets ? [autoAdjustsScrollViewInsets boolValue] : false;
|
|
396
|
+
|
366
|
397
|
NSNumber *navBarTranslucent = self.navigatorStyle[@"navBarTranslucent"];
|
367
|
398
|
BOOL navBarTranslucentBool = navBarTranslucent ? [navBarTranslucent boolValue] : NO;
|
368
|
|
- if (navBarTranslucentBool || navBarBlurBool)
|
369
|
|
- {
|
|
399
|
+ if (navBarTranslucentBool || navBarBlurBool) {
|
370
|
400
|
viewController.navigationController.navigationBar.translucent = YES;
|
371
|
|
- }
|
372
|
|
- else
|
373
|
|
- {
|
|
401
|
+ } else {
|
374
|
402
|
viewController.navigationController.navigationBar.translucent = NO;
|
375
|
403
|
}
|
376
|
|
-
|
|
404
|
+
|
|
405
|
+ NSNumber *extendedLayoutIncludesOpaqueBars = self.navigatorStyle[@"extendedLayoutIncludesOpaqueBars"];
|
|
406
|
+ BOOL extendedLayoutIncludesOpaqueBarsBool = extendedLayoutIncludesOpaqueBars ? [extendedLayoutIncludesOpaqueBars boolValue] : NO;
|
|
407
|
+ viewController.extendedLayoutIncludesOpaqueBars = extendedLayoutIncludesOpaqueBarsBool;
|
|
408
|
+
|
377
|
409
|
NSNumber *drawUnderNavBar = self.navigatorStyle[@"drawUnderNavBar"];
|
378
|
410
|
BOOL drawUnderNavBarBool = drawUnderNavBar ? [drawUnderNavBar boolValue] : NO;
|
379
|
|
- if (drawUnderNavBarBool)
|
380
|
|
- {
|
|
411
|
+ if (drawUnderNavBarBool) {
|
381
|
412
|
viewController.edgesForExtendedLayout |= UIRectEdgeTop;
|
382
|
413
|
}
|
383
|
|
- else
|
384
|
|
- {
|
|
414
|
+ else {
|
385
|
415
|
viewController.edgesForExtendedLayout &= ~UIRectEdgeTop;
|
386
|
416
|
}
|
387
|
|
-
|
|
417
|
+
|
388
|
418
|
NSNumber *drawUnderTabBar = self.navigatorStyle[@"drawUnderTabBar"];
|
389
|
419
|
BOOL drawUnderTabBarBool = drawUnderTabBar ? [drawUnderTabBar boolValue] : NO;
|
390
|
|
- if (drawUnderTabBarBool)
|
391
|
|
- {
|
|
420
|
+ if (drawUnderTabBarBool) {
|
392
|
421
|
viewController.edgesForExtendedLayout |= UIRectEdgeBottom;
|
393
|
|
- }
|
394
|
|
- else
|
395
|
|
- {
|
|
422
|
+ } else {
|
396
|
423
|
viewController.edgesForExtendedLayout &= ~UIRectEdgeBottom;
|
397
|
424
|
}
|
398
|
|
-
|
|
425
|
+
|
399
|
426
|
NSNumber *removeNavBarBorder = self.navigatorStyle[@"navBarNoBorder"];
|
400
|
427
|
BOOL removeNavBarBorderBool = removeNavBarBorder ? [removeNavBarBorder boolValue] : NO;
|
401
|
|
- if(removeNavBarBorderBool)
|
402
|
|
- {
|
|
428
|
+ if (removeNavBarBorderBool) {
|
403
|
429
|
self.navBarHairlineImageView.hidden = YES;
|
404
|
|
- }
|
405
|
|
- else
|
406
|
|
- {
|
|
430
|
+ } else {
|
407
|
431
|
self.navBarHairlineImageView.hidden = NO;
|
408
|
432
|
}
|
409
|
433
|
|
|
@@ -422,15 +446,14 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
|
422
|
446
|
}
|
423
|
447
|
|
424
|
448
|
-(void)storeOriginalNavBarImages {
|
|
449
|
+
|
425
|
450
|
NSMutableDictionary *originalNavBarImages = [@{} mutableCopy];
|
426
|
451
|
UIImage *bgImage = [self.navigationController.navigationBar backgroundImageForBarMetrics:UIBarMetricsDefault];
|
427
|
|
- if (bgImage != nil)
|
428
|
|
- {
|
|
452
|
+ if (bgImage != nil) {
|
429
|
453
|
originalNavBarImages[@"bgImage"] = bgImage;
|
430
|
454
|
}
|
431
|
455
|
UIImage *shadowImage = self.navigationController.navigationBar.shadowImage;
|
432
|
|
- if (shadowImage != nil)
|
433
|
|
- {
|
|
456
|
+ if (shadowImage != nil) {
|
434
|
457
|
originalNavBarImages[@"shadowImage"] = shadowImage;
|
435
|
458
|
}
|
436
|
459
|
self.originalNavBarImages = originalNavBarImages;
|
|
@@ -453,34 +476,25 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
|
453
|
476
|
{
|
454
|
477
|
NSNumber *tabBarHidden = self.navigatorStyle[@"tabBarHidden"];
|
455
|
478
|
BOOL tabBarHiddenBool = tabBarHidden ? [tabBarHidden boolValue] : NO;
|
456
|
|
- if (tabBarHiddenBool)
|
457
|
|
- {
|
|
479
|
+ if (tabBarHiddenBool) {
|
458
|
480
|
self._hidesBottomBarWhenPushed = YES;
|
459
|
|
- }
|
460
|
|
- else
|
461
|
|
- {
|
|
481
|
+ } else {
|
462
|
482
|
self._hidesBottomBarWhenPushed = NO;
|
463
|
483
|
}
|
464
|
484
|
|
465
|
485
|
NSNumber *statusBarHideWithNavBar = self.navigatorStyle[@"statusBarHideWithNavBar"];
|
466
|
486
|
BOOL statusBarHideWithNavBarBool = statusBarHideWithNavBar ? [statusBarHideWithNavBar boolValue] : NO;
|
467
|
|
- if (statusBarHideWithNavBarBool)
|
468
|
|
- {
|
|
487
|
+ if (statusBarHideWithNavBarBool) {
|
469
|
488
|
self._statusBarHideWithNavBar = YES;
|
470
|
|
- }
|
471
|
|
- else
|
472
|
|
- {
|
|
489
|
+ } else {
|
473
|
490
|
self._statusBarHideWithNavBar = NO;
|
474
|
491
|
}
|
475
|
492
|
|
476
|
493
|
NSNumber *statusBarHidden = self.navigatorStyle[@"statusBarHidden"];
|
477
|
494
|
BOOL statusBarHiddenBool = statusBarHidden ? [statusBarHidden boolValue] : NO;
|
478
|
|
- if (statusBarHiddenBool)
|
479
|
|
- {
|
|
495
|
+ if (statusBarHiddenBool) {
|
480
|
496
|
self._statusBarHidden = YES;
|
481
|
|
- }
|
482
|
|
- else
|
483
|
|
- {
|
|
497
|
+ } else {
|
484
|
498
|
self._statusBarHidden = NO;
|
485
|
499
|
}
|
486
|
500
|
}
|
|
@@ -493,16 +507,13 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
|
493
|
507
|
|
494
|
508
|
- (BOOL)prefersStatusBarHidden
|
495
|
509
|
{
|
496
|
|
- if (self._statusBarHidden)
|
497
|
|
- {
|
|
510
|
+ if (self._statusBarHidden) {
|
498
|
511
|
return YES;
|
499
|
512
|
}
|
500
|
|
- if (self._statusBarHideWithNavBar)
|
501
|
|
- {
|
|
513
|
+
|
|
514
|
+ if (self._statusBarHideWithNavBar) {
|
502
|
515
|
return self.navigationController.isNavigationBarHidden;
|
503
|
|
- }
|
504
|
|
- else
|
505
|
|
- {
|
|
516
|
+ } else {
|
506
|
517
|
return NO;
|
507
|
518
|
}
|
508
|
519
|
}
|
|
@@ -514,12 +525,9 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
|
514
|
525
|
|
515
|
526
|
- (UIStatusBarStyle)preferredStatusBarStyle
|
516
|
527
|
{
|
517
|
|
- if (self._statusBarTextColorSchemeLight)
|
518
|
|
- {
|
|
528
|
+ if (self._statusBarTextColorSchemeLight){
|
519
|
529
|
return UIStatusBarStyleLightContent;
|
520
|
|
- }
|
521
|
|
- else
|
522
|
|
- {
|
|
530
|
+ } else {
|
523
|
531
|
return UIStatusBarStyleDefault;
|
524
|
532
|
}
|
525
|
533
|
}
|