+[UIWindow _statusBarControllingWindow] should return +[UIWindow keyWindow]

Originator:joachimb
Number:rdar://15573442 Date Originated:03-Dec-2013 01:21 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 7.0
Classification:Other Bug Reproducible:Always
 
Summary:
As it is now, it seems like the status bar appearance is affected by the *topmost window* rather than the *key window*. I'm presenting a UIWindow at Status Bar level in order to overlay some stuff over my existing app without affecting it. It only contains a few pixels of information, and should not affect the status bar. Yet, when my window is presented, -[UIViewController preferredStatusBarStyle] stops being called on my app's view controllers.
 
A few possible alternatives:
1. +[UIWindow _statusBarControllingWindow] returns +[UIWindow keyWindow] instead of the top window. Maybe you wrote it this way to support non-VC windows like alerts, so perhaps this wouldn't work. (alternatively, you should make alerts be VCs).
2. An API to control whether a window affects the status bar. Perhaps a -[UIWindow (BOOL)affectsStatusBar].
3. #2, but being implicitly NO when userInteractionEnabled is NO for that window.

Steps to Reproduce:
1. Overload preferredStatusBarStyle in a VC
2. Present a non-interactable UIWindow on top of your app
3. Navigate to the VC in #1

Expected Results:
4. Status bar gets the preferred style of the new VC

Actual Results:
4. Status bar is unaffected

Version:
iOS 7.0

Notes:


Configuration:


Attachments:

Comments

Sample application: https://github.com/nevyn/OverlayWindowTest

By joachimb at Sept. 2, 2015, 4 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com 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!