Cannot draw over the status bar on iOS 13

Hi,


My project uses a library that launches in app notification and these are presented over the status bar for a couple of seconds.

On iOS 13 this component stopped drawing over the status bar and the status bar components are overlapping it.



Any idea of what can be done to solve this? I suspect the project is in the flag UIWindow.Level.statusBar.

Thank you.

Replies

My image has been removed, here is the link: https://imgur.com/a/dz553L3

Is it a library of your own ?


Or have you access to source code ?


Otherwise, you should contact the library's authors.

I am trying to post a screenshot of the problem but the mods are asleep and not approving my comment with the link.

Anyway here is the screenshot (remove the spaces): https ://imgur.com/ a/dz5 53L3

And no it's not a library, there is something wrong with my UIViewController or the AVAudioRecorder. I am doing nothing special.


The "library" source code was modified by me and I know how it works at least, the component is drawing correctly but below the status bar, should be above.
Here is another project with the same issue: https: //github.com/evicoli/ Notifica tionBanner

I can confirm this happens on iOS 13 but didn't happen on iOS12 or previous versions of iOS.


It's basically impossible to place any view on the screen on top of the Status Bar (even if temporary). Many libraries that draw temporary things on top of the status area are affected.


Note that on iPhoneX this isn't so much of a problem as the notch area is usually avoided.


But on iPad, iPhone 8, 7, 6, 5, etc, this new "feature" of iOS 13 is limiting and quite annoying. See attached screenshot:

iOS13 - Broken:

i.imgur.com/5vWjWeh.png


iOS 12 and before - Works:

i.imgur.com/ncpQaRd.png

Did you set the bar relative to safe area ?


Should try adding a constraint for this.

The bar is in the correct position, I want to draw it over the status bar...

Effectively, clear.


Could you hide the status bar temporarily ?


https://stackoverflow.com/questions/24236912/how-do-i-hide-the-status-bar-in-a-swift-ios-app


You should check also if the VC presentation if automatic or fullScreen (I would try with fullScreen).

My modified version of this library works on iPhone X running iOS 12 or below. It just extends the whole component over the notch height + status bar height.

Also happens on fullscreen.

Bump since this does seem like a bug with UIWindowLevel / UIWindowLevelStatusBar that was introduced in iOS 13. I also noticed in iOS 13 that my UIWindow's got added to a UIWindowScene, so I suspect there may be some interference from that.