0

I have used UINavigationController to create navigation flow, first screen is List view controller and second one is detail view controller of list item.

I am hiding navigation bar in both view controllers because I have created my own top bar.

Now I am trying to change status bar content to light content but

override var preferredStatusBarStyle: UIStatusBarStyle{
   .lightContent
}

This is not getting called. I read multiple answers about changing status bar content style when UINavigationController is used but none of them help because I am hiding navigation bar.

Navigation controller is embedded in TabBarController.

Attaching the image for reference Image

1 Answers1

0

First hide navigation bar in viewDidLoad() by hit the below code

self.navigationController?.navigationBarHidden = true

Add the status bar code in ViewController like you did

override var preferredStatusBarStyle: UIStatusBarStyle{
   return .lightContent
}
  • Thanks for the answer but I am already hiding the navigation bar and then overriding the status bar style. This is not working control doesn't reach there at all. – Aniket Kote Mar 18 '21 at 07:03