Skip to content

Commit 1fe8d58

Browse files
sbuggayfacebook-github-bot
authored andcommitted
Remove sharedApplication use in SafeAreaProxy (facebook#49612)
Summary: Pull Request resolved: facebook#49612 `[UIApplication sharedApplication]` is not allowed in Mac Catalyst. This #ifdef's it out which is a common pattern elsewhere. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D69971189 fbshipit-source-id: 89dbc0a02ed2a06936f910fbfc13e1fb91972540
1 parent 814e1eb commit 1fe8d58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/react-native/React/Base/UIKitProxies/RCTWindowSafeAreaProxy.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ - (UIEdgeInsets)currentSafeAreaInsets
5353

5454
// Fallback in case [startObservingSafeArea startObservingSafeArea] was not called.
5555
__block UIEdgeInsets insets;
56+
#if !TARGET_OS_MACCATALYST
5657
RCTUnsafeExecuteOnMainQueueSync(^{
5758
insets = [UIApplication sharedApplication].delegate.window.safeAreaInsets;
5859
});
60+
#endif
5961
return insets;
6062
}
6163

0 commit comments

Comments
 (0)