Is there a way how to set the default status bar style while keeping the
Here is the problem, I'm dealing with:
Nearly the whole app needs to be using
The easiest and cleanest way who to achieve that is to add the following line in
UINavigationBar.appearance().barStyle = .Black
This will make
.LightContent as the default status bar style thorough the app as long as your app uses
Don't forget to keep the following setting in app's
Info.plist if want to use
.LightContent status bar style during launch for splash screen:
My current setup, which is very similar to many other apps, uses
UITabBarController as the top most controller with
UINavigationController stack for each tab.
UINavigationController takes care of the status bar style (as it should) and do not call
preferredStatusBarStyle() on its child view controllers. Therefore, implementing the subclassing solution proposed by par does not work in my case.
Further subclassing the custom subclass of
UINavigationController I'm using would not be a clean solution either.
Now, since the app has
UIViewControllerBasedStatusBarAppearance enabled and correct status bar style everywhere in the app itself,
SFSafariViewController and share extension like Messages, Mail, etc use the correct (
.Default) status bar style too.
The only exception where the correct status bar style is not used is the Facebook Messenger's share extension mentioned in the question. However, it seems to be a bug in the extension itself as all apps I have tried that use
.LightContent status bar style (like Twitter, for example) have the same issue - presented FB Messenger share extension from the app has a status bar with white color text.