This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid crashing the app if the app delegate is written in Swift and do…
…esn't have a window property Summary: `window` is an optional property. If an `UIApplicationDelegate` is implemented in Swift and doesn't implement this property, the current code will crash. This was the case for NativeUIPreview's app delegate (used for [iOS Snapshot Test Previews](https://fb.workplace.com/groups/735885229793428/posts/25216903081264969/)): https://www.internalfb.com/code/fbsource/[e59804301a3c]/fbobjc/Configurations/Buck/NativeUIPreview/AppDelegate.swift?lines=6-10 This diff fixes the crash itself, although we may want to do think about a better way to get the size of the window (eg: using `UIWindowSceneDelegate` instead?). Reviewed By: LukeDefeo Differential Revision: D65665540 fbshipit-source-id: 481c76a934d07d2cdc632dbedae6fbabee3c4a9a
- Loading branch information