Skip to content

Commit

Permalink
fix: add ifdef to status bar APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Feb 13, 2024
1 parent bf8b383 commit 7374a89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ - (void)setActivityStateOrNil:(NSNumber *)activityStateOrNil
}
}

#if !TARGET_OS_TV
#if !TARGET_OS_TV && !TARGET_OS_VISION
- (void)setStatusBarStyle:(RNSStatusBarStyle)statusBarStyle
{
_hasStatusBarStyleSet = YES;
Expand Down
2 changes: 1 addition & 1 deletion ios/RNSScreenWindowTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

+ (void)updateWindowTraits;

#if !TARGET_OS_TV
#if !TARGET_OS_TV && !TARGET_OS_VISION
+ (void)assertViewControllerBasedStatusBarAppearenceSet;
#endif
+ (void)updateStatusBarAppearance;
Expand Down
8 changes: 4 additions & 4 deletions ios/RNSScreenWindowTraits.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@implementation RNSScreenWindowTraits

#if !TARGET_OS_TV
#if !TARGET_OS_TV && !TARGET_OS_VISION
+ (void)assertViewControllerBasedStatusBarAppearenceSet
{
static dispatch_once_t once;
Expand All @@ -25,8 +25,8 @@ + (void)updateStatusBarAppearance
#if !TARGET_OS_TV && !TARGET_OS_VISION
[UIView animateWithDuration:0.4
animations:^{ // duration based on "Programming iOS 13" p. 311 implementation
[RCTKeyWindow().rootViewController setNeedsStatusBarAppearanceUpdate];
}];
[RCTKeyWindow().rootViewController setNeedsStatusBarAppearanceUpdate];
}];
#endif
}

Expand Down Expand Up @@ -112,7 +112,7 @@ + (void)enforceDesiredDeviceOrientation
#if !TARGET_OS_TV && !TARGET_OS_VISION
dispatch_async(dispatch_get_main_queue(), ^{
UIInterfaceOrientationMask orientationMask = [RCTKeyWindow().rootViewController supportedInterfaceOrientations];

UIInterfaceOrientation currentDeviceOrientation =
[RNSScreenWindowTraits interfaceOrientationFromDeviceOrientation:[[UIDevice currentDevice] orientation]];
UIInterfaceOrientation currentInterfaceOrientation = [RNSScreenWindowTraits interfaceOrientation];
Expand Down

0 comments on commit 7374a89

Please sign in to comment.