Skip to content

Commit

Permalink
Suppress deprecated status bar APIs in RCTStatusBarManager (#49315)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #49315

Changelog: [iOS][Fixed] Suppressed iOS 13 deprecation warnings in RCTStatusBarManager

Reviewed By: NickGerleman

Differential Revision: D69334478

fbshipit-source-id: b643c52d928f95f33659a643d0cc1d7de1f65563
  • Loading branch information
Ingrid Wang authored and facebook-github-bot committed Feb 11, 2025
1 parent f835b82 commit fffd6d7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ + (BOOL)requiresMainQueueSetup
- (void)startObserving
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[nc addObserver:self
selector:@selector(applicationDidChangeStatusBarFrame:)
name:UIApplicationDidChangeStatusBarFrameNotification
Expand All @@ -88,6 +90,7 @@ - (void)startObserving
selector:@selector(applicationWillChangeStatusBarFrame:)
name:UIApplicationWillChangeStatusBarFrameNotification
object:nil];
#pragma clang diagnostic pop
}

- (void)stopObserving
Expand All @@ -97,7 +100,10 @@ - (void)stopObserving

- (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notification
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CGRect frame = [notification.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue];
#pragma clang diagnostic pop
NSDictionary *event = @{
@"frame" : @{
@"x" : @(frame.origin.x),
Expand Down

0 comments on commit fffd6d7

Please sign in to comment.