0

I am trying to change the status bar style in my iOS 13.0 app but when I use the code;

   UIApplication.shared.statusBarStyle = .lightContent

I get the warning in Xcode;

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

The problem is that the property statusBarManager?.statusBarStyle is a get only property so how can I change the status bar style programmatically?

Stephen501
  • 153
  • 8
  • you can find your solution using below the link: [statusbarstyle change](https://stackoverflow.com/questions/52238121/how-to-change-status-bar-style-ios-12) – Vaibhav Khatri Apr 13 '22 at 16:13
  • This should be done at the view controller – Leo Dabus Apr 13 '22 at 16:16
  • @VaibhavKhatri I have tried all of those solutions and none of them work. Its very confusing as well because some contributors say set YES and some say set NO to the plist Key. – Stephen501 Apr 13 '22 at 17:23
  • @LeoDabus The only way it will work is if I use ```UIApplication.shared.statusBarStyle = .lightContext``` or ```UIApplication.shared.statusBarStyle = .default``` programmatically with the Info.plist key value set to NO. – Stephen501 Apr 13 '22 at 17:30

1 Answers1

1

Set View controller-based status bar appearance key value in info.plist to NO and programmatically set UIApplication.shared.statusBarStyle to either .lightContent or .default.

Stephen501
  • 153
  • 8