1

In IOS 11 and 12 I have used

[[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"]

to hide the status bar by changing the height. In IOS 13 using statusBarManager can get the statusBarFrame and change the height but it's not getting changed in the view. Does anyone know how to change the status bar frame in the IOS 13?

1 Answers1

0

If you need the status bar frame only to show/hide it, there is more correct way to do it by overriding the var prefersStatusBarHidden: Bool for the interested View Controllers

Please review my answer here for more detailed explanations.

Though, if you still need the status bar frame for any other reason, you could obtain it in your View Controller like this

let statusBarManager = view.window?.windowScene?.statusBarManager
let height = statusBarManager?.statusBarFrame.height ?? 0
vhristoskov
  • 2,074
  • 2
  • 16
  • 20