Skip to content

Commit 5e79fa8

Browse files
evoactivityfacebook-github-bot
authored andcommitted
Remove usage of UIApplication.sharedApplication (#34787)
Summary: Brings in line with rest of code base and avoids running into this error ``` ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead. ``` when `Requires Only App-Extension-Safe-API` is set to Yes. ## Changelog [iOS] [Fixed] - Update usage of UIApplication.sharedApplication in RCTKeyCommands Pull Request resolved: #34787 Test Plan: Setting `Requires Only App-Extension-Safe-API` to Yes before this change means the app will not compile, after the change it does. Reviewed By: dmytrorykun Differential Revision: D39812410 Pulled By: cipolleschi fbshipit-source-id: 78d185ba20301b10609e4a387f000f0cfda55663
1 parent cc13b02 commit 5e79fa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

React/Base/RCTKeyCommands.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ - (void)handleKeyUIEventSwizzle:(UIEvent *)event
128128
isKeyDown = [event _isKeyDown];
129129
}
130130

131-
BOOL interactionEnabled = !UIApplication.sharedApplication.isIgnoringInteractionEvents;
131+
BOOL interactionEnabled = !RCTSharedApplication().isIgnoringInteractionEvents;
132132
BOOL hasFirstResponder = NO;
133133
if (isKeyDown && modifiedInput.length > 0 && interactionEnabled) {
134134
UIResponder *firstResponder = nil;

0 commit comments

Comments
 (0)