mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Suppress deprecated status bar APIs in RCTStatusBarManager (#49315)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49315 Changelog: [iOS][Fixed] Suppressed iOS 13 deprecation warnings in RCTStatusBarManager Reviewed By: NickGerleman Differential Revision: D69334478 fbshipit-source-id: b643c52d928f95f33659a643d0cc1d7de1f65563
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f835b824f4
commit
fffd6d75b4
@@ -80,6 +80,8 @@ RCT_EXPORT_MODULE()
|
||||
- (void)startObserving
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[nc addObserver:self
|
||||
selector:@selector(applicationDidChangeStatusBarFrame:)
|
||||
name:UIApplicationDidChangeStatusBarFrameNotification
|
||||
@@ -88,6 +90,7 @@ RCT_EXPORT_MODULE()
|
||||
selector:@selector(applicationWillChangeStatusBarFrame:)
|
||||
name:UIApplicationWillChangeStatusBarFrameNotification
|
||||
object:nil];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (void)stopObserving
|
||||
@@ -97,7 +100,10 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (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),
|
||||
|
||||
Reference in New Issue
Block a user