I'm adding new UIWindow to show passcode view controller when the app is entering foreground.
Before iOS 13 in AppDelegate I had property var passcodeWindow = UIWindow(frame: UIScreen.main.bounds) where my rootViewController was the passcode view controller and in applicationWillEnterForeground method I was doing passcodeWindow.makeKeyAndVisible() to place it on the top.
Now when I want to implement the passcode functionality in iOS 13 there is a problem with this approach. I moved it to the sceneWillEnterForeground method in SceneDelegate, but it seems like I can't show passcodeWindow on top of the actual window in this scene.
I do it exactly the same as in AppDelegate and the passcodeWindow is not shown.
The way I do it in sceneWillEnterForeground in AppDelegate and in SceneDelegate:
passcodeWindow.rootViewController = passcodeViewController(type: .unlock)
passcodeWindow.makeKeyAndVisible()
I expect passcodeWindow to show on the top of current window in the scene.