Show/Hide Status bar using key-value of UIApplication.shared
.
I have tried Overriding method prefersStatusBarHidden
but it didn't get the result.
Asked
Active
Viewed 839 times
1

ilyas
- 94
- 1
- 2
- 7
-
https://stackoverflow.com/a/52037589/8294374 – Enea Dume Nov 19 '18 at 09:46
-
@EneaDume it is deprecated – ilyas Nov 19 '18 at 09:51
-
Refer this: https://stackoverflow.com/a/44066303/6059313 – Sharad Chauhan Nov 19 '18 at 10:00
-
Check this out, this guy had the same issue as you : https://stackoverflow.com/questions/35028262/how-to-hide-status-bar-of-a-single-view-controller-in-ios-9 – YD- Nov 19 '18 at 11:33
1 Answers
0
View controller without status bar
class ViewControllerWithoutStatusBar: UIViewController {
//your logic here
override var prefersStatusBarHidden: Bool {
return false
}
}
View controller with status bar
class ViewControllerWithStatusBar: UIViewController {
//your here here
override var prefersStatusBarHidden: Bool {
return true
}
}

Dmitry
- 2,963
- 2
- 21
- 39