Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid calling keyWindow on any UIScene (facebook#46832)
Summary: 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
- Loading branch information