Skip to content

Commit

Permalink
feat(keyboard): Make resize work in apps that use scenes (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Dec 7, 2021
1 parent cf0d214 commit 6dde082
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions keyboard/ios/Plugin/Keyboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,15 @@ - (void)_updateFrame
_paddingBottom = _paddingBottom + 20;
}
CGRect f, wf = CGRectZero;
id<UIApplicationDelegate> delegate = [[UIApplication sharedApplication] delegate];
if (delegate != nil && [delegate respondsToSelector:@selector(window)]) {
f = [[delegate window] bounds];
UIWindow * window = [[[UIApplication sharedApplication] delegate] window];
if (!window) {
if (@available(iOS 13.0, *)) {
UIScene *scene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject;
window = [[(UIWindowScene*)scene windows] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isKeyWindow == YES"]].firstObject;
}
}
if (window) {
f = [window bounds];
}
if (self.webView != nil) {
wf = self.webView.frame;
Expand Down

0 comments on commit 6dde082

Please sign in to comment.