When I run my project on ios13 xcode11 beta.
[UIApplication sharedApplication].statusBarFrame.size.height
the code returns 0.
what should I do to adapt it to ios13 ?
You can change the status bar colour just with a single line of code. Just updated the markdown for iOS 13 and below.
To change the StatusBar background colour, i have created a base class of UIViewController so that i can inherit same code in all the view controllers. Added "statusBarColorChange()" to UIViewController extension. Created Base Class and inherited in other classes. Show activity on this post.
Use UIStatusBarManager to get the statusBar height in iOS13:
UIStatusBarManager *manager = [UIApplication sharedApplication].keyWindow.windowScene.statusBarManager;
CGFloat height = manager.statusBarFrame.size.height;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With