all trying to hide status bar with Xcode 8.2 with swift 3. but I can't hide it.
and also for,
You can Approach this in two ways
Option 1.Try this in
didFinishLaunchingWithOptions
Method
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UIApplication.shared.isStatusBarHidden = true
return true
}
Option 2. override
prefersStatusBarHidden
function in yourUIViewController
override var prefersStatusBarHidden : Bool {
return true
}
Note: you call override func prefersStatusBarHidden
it should be override var prefersStatusBarHidden
override prefersStatusBarHidden
in your view controller
override var prefersStatusBarHidden : Bool {
return true
}
true if the status bar should be hidden or false if it should be shown.
Refer apple doc link