RoBo-Inc
(โรมัน)
1
If ViewController is in a NavigationController (and the NavigationBar isn't hidden), then the StatusBar color is determined by the NavigationController:
-
If we override preferredStatusBarStyle variable of the NavigationController, we will get the desired color.
-
If we override childViewControllerForStatusBarStyle of the NavigationController, we will get the same color as chosen ViewController (which determined by preferredStatusBarStyle variable of that ViewController).
-
The question is: What will happen if we override the both variables?
Spoiler: Experiments show that results in all three situations are different.
The logic of situation 3) I don't understand.
PS. Looks like Xcode has a bug. If we launch app from Xcode neither preferredStatusBarStyle nor childViewControllerForStatusBarStyle isn't called at all. So StatusBar color depends on how we launch the app. But that's not related to the question.