ArtSabintsev / Siren

Notify users when a new version of your app is available and prompt them to upgrade.
http://sabintsev.com/
MIT License
4.25k stars 407 forks source link

[iOS14] Status bar color during Siren alert presentation #351

Closed giofid closed 3 years ago

giofid commented 3 years ago

Hi @ArtSabintsev, I'm experiencing a problem with status bar style/color. Only in iOS14 the status bar changes color during the Siren alert presentation.

siren Siren-master.zip

As you can see, the status bar is black before the alert is shown, it becomes wrongly white during Siren alert presentation and it comes back black after the alert disappears.

If I comment the preferredStatusBarStyle overriding in SirenViewController class, the problem goes away.

What is the purpose of this overriding? Is it possible to remove it?

ArtSabintsev commented 3 years ago

It's needed to fix an issue on iOS 13, for which I do not recall the details. I can look into it a bit later.

There's also older reasons for it being there. There might be an exception we need to put in for iOS 14.

ArtSabintsev commented 3 years ago

Also, I think your screenshots maybe wrong based on your explanation?

giofid commented 3 years ago

I replaced the screenshots with a gif. I hope it's much clearer now. As you can see, the statusbar is initially black, it becomes white when alert appears and it comes back black after the alert disappears.

The problem occurs only on iOS14.

I also attach a slightly modified version of the demo that shows the problem.

Thank you.

ArtSabintsev commented 3 years ago

This should be fixed in v5.5.1 and beyond, which was just released.

Thanks!

giofid commented 3 years ago

Thank you @ArtSabintsev. The problem is now fixed!

Can I ask you what's the purpose of retaining the window in SirenViewController? I tried to comment this line and everything keeps working. Is this retain cycle no more needed?

ArtSabintsev commented 3 years ago

It was to fix this issue: https://github.com/ArtSabintsev/Siren/issues/305

Also, I may need to revert this change I made in this PR in the future since it was apparently attempting to fix a SceneDelegate issue in iOS 13. I’ll wait to see if anyone reports that issue still existing.