Skip to content

Commit

Permalink
fix(ios): apply filter to fetch correct scene object (#2102)
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-ricardomoreirasilva committed May 14, 2024
1 parent 20b9e26 commit acd334d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keyboard/ios/Sources/KeyboardPlugin/Keyboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit acd334d

Please sign in to comment.