mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46832 After bumping to minIOSVersion 15.1, we refactored the code to remove some check. In the refactoring, we changed how the `keyWindow` is returned and now we are unsafely casting `UIScene` to `UIWindowScene`. We have some internal apps that use `UIScene` that are not `UIWindowScene` and the change is causing them to crash. This change fixes the crash by checking whether the selector is available in the UIScene and casting it only in that case. Otherwise we return `nil`, the same behavior we used to have before the refactor. ## Changelog [iOS][Fixed] - Cast the UIScene to UIWindowScene only if the scene respond to the selector Reviewed By: javache Differential Revision: D63890980 fbshipit-source-id: 3230e0075f06ed3f3d759b48f9c7bd13d8787b44