Question

I have 2 UIWindows, when I show both UIWindows the latest shown UIWindow always is above the 1st shown UIWindow. Each UIWindow is an own UIWindow, so no Subview.

Does anyone know how i can place a UIWindow behind another UIWindow?

Was it helpful?

Solution

While I suspect there's probably a cleaner, more maintainable way to achieve what you want, you should be able to manipulate the order windows appear using the windowLevel property - although to be honest the last time I tried to do this was on iOS 5 so maybe that's changed. But generally you'd do something like:

windowToPlaceInFront.windowLevel = windowToPutInBack.windowLevel + 1.0f;

OTHER TIPS

You cannot have multiple UIWindow inside an app.

From Apple documentation (https://developer.apple.com/library/ios/documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html):

Unless an app can display content on an external device screen, an app has only one window.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top