0

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?

Rutger Huijsmans
  • 2,330
  • 2
  • 30
  • 67

2 Answers2

1

Try this.

Add below entries in info.plist

View controller-based status bar appearance -> YES

Status bar is initially hidden -> YES

enter image description here

And In ViewControllers, In which you want to hide the StatusBar, Write below method.

override var prefersStatusBarHidden: Bool {  
    return true  
}  
Wolverine
  • 4,264
  • 1
  • 27
  • 49
0

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

iOS Developer
  • 437
  • 4
  • 11