How to hide, show or change the status bar dynamically on events such as click or value change?
I've googled for a well, but all I get is changed from the beginning as this. Here I need to do it dynamically.
How to hide, show or change the status bar dynamically on events such as click or value change?
I've googled for a well, but all I get is changed from the beginning as this. Here I need to do it dynamically.
Well for this you can do following based on events:
//For hiding/unhiding:
    func hideStatusBar(shouldHide:Bool){
     UIApplication.shared.isStatusBarHidden = shouldHide
    }
    //For Light Style:
    func lightStatusBar(){
        UIApplication.shared.statusBarStyle = .lightContent
    }
    //For Standard Style:
    func standardStatusBar(){
        UIApplication.shared.statusBarStyle = .default
    }
or you can tweak prefersStatusBarHidden: as well.
 
    
    You are looking for var prefersStatusBarHidden: Bool { get }
Override that function in your view controller. Dynamically update the visibility of your statusbar with func setNeedsStatusBarAppearanceUpdate()
https://developer.apple.com/reference/uikit/uiviewcontroller/1621440-prefersstatusbarhidden
