In our application, we present 3 viewControllers on 3 different UIWindow
s.
We had issue with arrangement of these modals. I tried to fix the issue by adjusting the window.windowLevel
property for each UIWindow
.
For some unknown reason, the fix works on iOS 13.1.2
but not on iOS 12.1.1
. Any idea? Thanks.
I believe
windowLevel
is not a property you are looking for at all. Even if this works or should work it is incidental as this property describes window presentation style more that order of windows.You could keep removing/adding windows or even making them hidden as part of normal API. Or you could just use
makeKeyAndVisible
on the window you want to see on top.See the following quick example of usage:
Lazily 3 windows are loaded each having a view controller with it's own distinct color. When you tap the screen a "next" window should appear on top so you can keep toggling between the windows.
An even safer implementation could be as easy as the following: