Status bar Actions
During the swift development process, there are a number of procedures for status bar operations.
1. Operate the status bar of the current Viewcontroller in Viewcontroller
[OBJC]View Plaincopy
- /**
- Hides the status bar
- */
- Override func prefersstatusbarhidden () -> bool {
- return true;
- }
-   
- /**
- < span class= "comment" > set the status bar style
- */&NBSP;&NBSP;
- override func preferredstatusbarstyle () -> uistatusbarstyle {
- return uistatusbarstyle
- }
2. Set the status bar in Appdelegate
[OBJC]View Plaincopy
- Func Setupwithstatusbar (application:uiapplication) {
- //Set status bar to hide
- Application. Statusbarhidden = true;
- Application. Setstatusbarhidden (True, withanimation:uistatusbaranimation. Fade);
- //Set status bar highlighting
- Application. Statusbarstyle = Uistatusbarstyle. Lightcontent;
- Application. Setstatusbarstyle (Uistatusbarstyle. Lightcontent, animated: true);
- }
3. Configure status bar properties via Plist file
iOS development--Useful articles for Swift & status bar operations