Adding a second UIWindow breaks rotation logic in iOS 8

Number:rdar://19592583 Date Originated:25-Jan-2015 02:01 PM
Status:Open Resolved:
Product:iOS Product Version:
Classification: Reproducible:
Adding a hidden window on iOS is a common way to add HUD overlay elements or other small features - iOS does this as well with it's text effects window. In iOS 8 however, a hidden window now affects rotation. As soon as we call addWindowForHUD the view rotates, which is should not. For some reason the rootViewController of the hidden view is consulted instead of the keyWindow's rootViewController. This is a regression from iOS 7.

Steps to Reproduce:
Open attached WindowRotationIssue example. Works on both iOS 7 and 8. Only iOS 8 exhibits the bug.

Expected Results:
Only the keyWindow should be consulted for rotation callbacks.

Actual Results:
The rootViewController in our hidden window is called for rotation callbacks.

This is a regression from iOS 7.

Looking at -[UIWindow setRootViewController:] there's a new UIApplicationLinkedOnOrAfter check for iOS 8 that calls tryBecomeRootViewControllerInWindow: if running iOS 8.

Here’s my full debug log for this issue:


I guess this is the same bug as


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!