Set status bar?

How to hide, show or change a dynamic status bar during events such as clicking or changing a value?

I was looking for a search well, but everything I get changes from the very beginning how. Here I need to do it dynamically.

0
ios swift statusbar
May 03 '17 at 6:34 a.m.
source share
3 answers

Good for this you can do the 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 configure prefersStatusBarHidden :.

+1
May 03 '17 at 6:40 a.m.
source share

UIApplication.sharedApplication (). SetStatusBarHidden = true

+1
May 03 '17 at 6:40 a.m.
source share

You are looking for var prefersStatusBarHidden: Bool { get }

Override this function in the view controller. Dynamically update the visibility of your status bar with func setNeedsStatusBarAppearanceUpdate()

https://developer.apple.com/reference/uikit/uiviewcontroller/1621440-prefersstatusbarhidden

+1
May 03 '17 at 6:40 a.m.
source share



All Articles