Reputation: 2408
I'm trying to hide the statusbar on the landingpage of my app only. I figured this is the right function and it does get executed, however the status bar still remains there
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
FBSDKLoginManager().logOut()
self.prefersStatusBarHidden()
}
override func prefersStatusBarHidden() -> Bool {
return true
}
What am I doing wrong?
Upvotes: 0
Views: 500
Reputation: 4329
Try this.
Add below entries in info.plist
View controller-based status bar appearance -> YES
Status bar is initially hidden -> YES
And In ViewControllers, In which you want to hide the StatusBar, Write below method.
override var prefersStatusBarHidden: Bool {
return true
}
Upvotes: 2
Reputation: 437
Set value "No" for key "View controller-based status bar appearance" in plist file
and No need to call "self.prefersStatusBarHidden()" manually so remove it from viewDidAppear
Upvotes: 0