Skip to content

Commit

Permalink
fix: apply filter to fetch correct scene object
Browse files Browse the repository at this point in the history
Avoids breaking apps that use Apple CarPlay.

References: https://outsystemsrd.atlassian.net/browse/RMET-3229
  • Loading branch information
OS-ricardomoreirasilva committed May 13, 2024
1 parent 41683f7 commit 8c7b13f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keyboard/ios/Plugin/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 8c7b13f

Please sign in to comment.