kiran
kiran

Reputation: 4409

Warning message on statusBarStyle on set lightContent

How to resolve this issue warning issue

UIApplication.shared.statusBarStyle = .lightContent

Warning Messages

'statusBarStyle' was deprecated in iOS 13.0: Use the statusBarManager property of the window scene instead.

Upvotes: 0

Views: 4168

Answers (2)

drodriguez
drodriguez

Reputation: 380

for me it worked this way

    override var preferredStatusBarStyle: UIStatusBarStyle { 
       return .lightContent 
    }

Upvotes: 1

regina_fallangi
regina_fallangi

Reputation: 2198

Use the statusBarManager (UIStatusBarManager):

Overwrite the preferredStatusBarStyle in your view controller and do this:

override var preferredStatusBarStyle: UIStatusBarStyle {
    .lightContent
}

You can have a BaseViewController: UIViewController {} class that controls that and make that all your VCs inherit from it.

Upvotes: 2

Related Questions