I\'m converting my iOS13 app for iPadOS to SceneDelegate (multi window).
How can I get the current UIWindow from the current SceneDelegate?
I know that a can
You'll want to simply iterate through all your windows and find the key window manually.
for (UIWindow *window in [UIApplication sharedApplication].windows) {
if (window.isKeyWindow) {
// you have the key window
break;
}
}
DO NOT use UISceneActivationStateForegroundActive
as the check. That means something different and folks are introducing bugs by using logic to find the first UISceneActivationStateForegroundActive
window scene.