@@ -79,7 +79,6 @@ + (BOOL)requiresMainQueueSetup
79
79
80
80
- (void )startObserving
81
81
{
82
- #if !TARGET_OS_VISION
83
82
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter ];
84
83
[nc addObserver: self
85
84
selector: @selector (applicationDidChangeStatusBarFrame: )
@@ -89,19 +88,15 @@ - (void)startObserving
89
88
selector: @selector (applicationWillChangeStatusBarFrame: )
90
89
name: UIApplicationWillChangeStatusBarFrameNotification
91
90
object: nil ];
92
- #endif
93
91
}
94
92
95
93
- (void )stopObserving
96
94
{
97
- #if !TARGET_OS_VISION
98
95
[[NSNotificationCenter defaultCenter ] removeObserver: self ];
99
- #endif
100
96
}
101
97
102
98
- (void )emitEvent : (NSString *)eventName forNotification : (NSNotification *)notification
103
99
{
104
- #if !TARGET_OS_VISION
105
100
CGRect frame = [notification.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue ];
106
101
NSDictionary *event = @{
107
102
@" frame" : @{
@@ -112,7 +107,6 @@ - (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notifi
112
107
},
113
108
};
114
109
[self sendEventWithName: eventName body: event];
115
- #endif
116
110
}
117
111
118
112
- (void )applicationDidChangeStatusBarFrame : (NSNotification *)notification
@@ -134,7 +128,6 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
134
128
135
129
RCT_EXPORT_METHOD (setStyle : (NSString *)style animated : (BOOL )animated)
136
130
{
137
- #if !TARGET_OS_VISION
138
131
dispatch_async (dispatch_get_main_queue (), ^{
139
132
UIStatusBarStyle statusBarStyle = [RCTConvert UIStatusBarStyle: style];
140
133
if (RCTViewControllerBasedStatusBarAppearance ()) {
@@ -143,16 +136,14 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
143
136
} else {
144
137
#pragma clang diagnostic push
145
138
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
146
- [RCTSharedApplication () setStatusBarStyle: statusBarStyle animated: animated];
147
- }
139
+ [RCTSharedApplication () setStatusBarStyle: statusBarStyle animated: animated];
140
+ }
148
141
#pragma clang diagnostic pop
149
142
});
150
- #endif
151
143
}
152
144
153
145
RCT_EXPORT_METHOD (setHidden : (BOOL )hidden withAnimation : (NSString *)withAnimation)
154
146
{
155
- #if !TARGET_OS_VISION
156
147
dispatch_async (dispatch_get_main_queue (), ^{
157
148
UIStatusBarAnimation animation = [RCTConvert UIStatusBarAnimation: withAnimation];
158
149
if (RCTViewControllerBasedStatusBarAppearance ()) {
@@ -161,24 +152,21 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
161
152
} else {
162
153
#pragma clang diagnostic push
163
154
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
164
- [RCTSharedApplication () setStatusBarHidden: hidden withAnimation: animation];
155
+ [RCTSharedApplication () setStatusBarHidden: hidden withAnimation: animation];
165
156
#pragma clang diagnostic pop
166
157
}
167
158
});
168
- #endif
169
159
}
170
160
171
161
RCT_EXPORT_METHOD (setNetworkActivityIndicatorVisible : (BOOL )visible)
172
162
{
173
- #if !TARGET_OS_VISION
174
163
dispatch_async (dispatch_get_main_queue (), ^{
175
164
#pragma clang diagnostic push
176
165
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
177
166
// This is no longer supported in iOS 13 and later. We will remove this method in a future release.
178
167
RCTSharedApplication ().networkActivityIndicatorVisible = visible;
179
168
#pragma clang diagnostic pop
180
169
});
181
- #endif
182
170
}
183
171
184
172
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)getConstants
0 commit comments