I want to show the status bar on portrait mode only, when I rotate the screen the status bar hides as intended but if I push / show a new View Controller the status bar appears again.
I've tried the following without success:
- Setting
View controller-based status bar appearance
toNO
in theinfo.plist
file - Using
setNeedsStatusBarAppearanceUpdate()
onself
and onNavigationController
- Setting
prefersStatusBarHidden: Bool
totrue
- Also tried
UIApplication.shared.setStatusBarHidden(true, with: UIStatusBarAnimation.none)
- Also extending NavigationController. seen here
Any help will be appreciated. Thanks.