@@ -79,7 +79,6 @@ + (BOOL)requiresMainQueueSetup
7979
8080- (void )startObserving
8181{
82- #if !TARGET_OS_VISION
8382 NSNotificationCenter *nc = [NSNotificationCenter defaultCenter ];
8483 [nc addObserver: self
8584 selector: @selector (applicationDidChangeStatusBarFrame: )
@@ -89,19 +88,15 @@ - (void)startObserving
8988 selector: @selector (applicationWillChangeStatusBarFrame: )
9089 name: UIApplicationWillChangeStatusBarFrameNotification
9190 object: nil ];
92- #endif
9391}
9492
9593- (void )stopObserving
9694{
97- #if !TARGET_OS_VISION
9895 [[NSNotificationCenter defaultCenter ] removeObserver: self ];
99- #endif
10096}
10197
10298- (void )emitEvent : (NSString *)eventName forNotification : (NSNotification *)notification
10399{
104- #if !TARGET_OS_VISION
105100 CGRect frame = [notification.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue ];
106101 NSDictionary *event = @{
107102 @" frame" : @{
@@ -112,7 +107,6 @@ - (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notifi
112107 },
113108 };
114109 [self sendEventWithName: eventName body: event];
115- #endif
116110}
117111
118112- (void )applicationDidChangeStatusBarFrame : (NSNotification *)notification
@@ -134,7 +128,6 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
134128
135129RCT_EXPORT_METHOD (setStyle : (NSString *)style animated : (BOOL )animated)
136130{
137- #if !TARGET_OS_VISION
138131 dispatch_async (dispatch_get_main_queue (), ^{
139132 UIStatusBarStyle statusBarStyle = [RCTConvert UIStatusBarStyle: style];
140133 if (RCTViewControllerBasedStatusBarAppearance ()) {
@@ -143,16 +136,14 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
143136 } else {
144137#pragma clang diagnostic push
145138#pragma clang diagnostic ignored "-Wdeprecated-declarations"
146- [RCTSharedApplication () setStatusBarStyle: statusBarStyle animated: animated];
147- }
139+ [RCTSharedApplication () setStatusBarStyle: statusBarStyle animated: animated];
140+ }
148141#pragma clang diagnostic pop
149142 });
150- #endif
151143}
152144
153145RCT_EXPORT_METHOD (setHidden : (BOOL )hidden withAnimation : (NSString *)withAnimation)
154146{
155- #if !TARGET_OS_VISION
156147 dispatch_async (dispatch_get_main_queue (), ^{
157148 UIStatusBarAnimation animation = [RCTConvert UIStatusBarAnimation: withAnimation];
158149 if (RCTViewControllerBasedStatusBarAppearance ()) {
@@ -161,24 +152,21 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
161152 } else {
162153#pragma clang diagnostic push
163154#pragma clang diagnostic ignored "-Wdeprecated-declarations"
164- [RCTSharedApplication () setStatusBarHidden: hidden withAnimation: animation];
155+ [RCTSharedApplication () setStatusBarHidden: hidden withAnimation: animation];
165156#pragma clang diagnostic pop
166157 }
167158 });
168- #endif
169159}
170160
171161RCT_EXPORT_METHOD (setNetworkActivityIndicatorVisible : (BOOL )visible)
172162{
173- #if !TARGET_OS_VISION
174163 dispatch_async (dispatch_get_main_queue (), ^{
175164#pragma clang diagnostic push
176165#pragma clang diagnostic ignored "-Wdeprecated-declarations"
177166 // This is no longer supported in iOS 13 and later. We will remove this method in a future release.
178167 RCTSharedApplication ().networkActivityIndicatorVisible = visible;
179168#pragma clang diagnostic pop
180169 });
181- #endif
182170}
183171
184172- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)getConstants
0 commit comments