I want to be able to add a small view behind the status bar or set the backgroundColor of the status bar. I have seen it in a couple of apps.
How do you add a backgroundColor to the status bar in swift?
I want to be able to add a small view behind the status bar or set the backgroundColor of the status bar. I have seen it in a couple of apps.
How do you add a backgroundColor to the status bar in swift?
How do you add a backgroundColor to the status bar
You don't. The status bar is transparent. You put something behind it that is the color you want! If your "something" is a 20-pixel-tall view with its top pinned to the top of the screen (i.e. the top of the root view controller's main view), it will exactly match the position of the status bar. There is no magic sauce for this; you just put a view, like any other view, in the right spot in your interface, where you know the status bar will end up in front of it.
Be sure to remove the backing view in situations where the status bar is removed (e.g. landscape). You can track status bar visibility with a notification.