diff --git a/keyboard/ios/Plugin/Keyboard.m b/keyboard/ios/Plugin/Keyboard.m index 38cd2edc4..29c070840 100644 --- a/keyboard/ios/Plugin/Keyboard.m +++ b/keyboard/ios/Plugin/Keyboard.m @@ -213,7 +213,8 @@ - (void)_updateFrame if (!window) { if (@available(iOS 13.0, *)) { - UIScene *scene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject; + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self isKindOfClass: %@", UIWindowScene.class]; + UIScene *scene = [UIApplication.sharedApplication.connectedScenes.allObjects filteredArrayUsingPredicate:predicate].firstObject; window = [[(UIWindowScene*)scene windows] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isKeyWindow == YES"]].firstObject; } }