Skip to content

Commit

Permalink
fix(ios): Check if UIApplicationDelegate responds to window selector (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven0351 authored Jun 10, 2022
1 parent 656f916 commit 5be1466
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion keyboard/ios/Plugin/Keyboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ - (void)_updateFrame
_paddingBottom = _paddingBottom + 20;
}
CGRect f, wf = CGRectZero;
UIWindow * window = [[[UIApplication sharedApplication] delegate] window];
UIWindow * window = nil;

if ([[[UIApplication sharedApplication] delegate] respondsToSelector:@selector(window)]) {
window = [[[UIApplication sharedApplication] delegate] window];
}

if (!window) {
if (@available(iOS 13.0, *)) {
UIScene *scene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject;
Expand Down

0 comments on commit 5be1466

Please sign in to comment.