I am developing an iOS app. It consists of several viewcontrollers. There are some viewcontrollers for registering and logging in, and other main viewcontrollers for using original feature.
I hid statusbar on the viewcontrollers for registering and loggin in. That works well like below screenshot.
But I wanted to display statusbar after registering. So I wrote some codes.
In AppDeletegate.swift, and other viewcontrollers(used after registering)
UIApplication.shared.statusBarView?.backgroundColor = UIColor(rgb: 0x7F7EBC)
However, it didn't work. If I register my account, and then according to code like this,
let storyboard = UIStoryboard(name: "App", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "appStoryboard")
self.present(vc, animated: true, completion: nil)
moving on main viewcontrollers, there is no statusbar like below image.
But there is the worse thing that makes me confused. If I restart the app, I can see the statusbar that has the color that I wanted to see. (If I finished registering process, When I restart the app, it moves straight to main viewcontrollers that consists of Tab Bar controller )
I tried to use almost all the codes on internet to change the color of statusbar, but it couldn't solve my problem.
It was my mistake. I added a code in a ViewController. That made statusbar empty.