My requirements are like, in my app there are two flows, so for both flows value of preferredStatusBarStyle & StatusBar background colour are different. So if I have 40 viewControllers
, 20 VCs have same values and 20VCs have different values than first 20 values.
For now I am changing values in each view controllers, like this:-
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarView?.backgroundColor = AppColors.themeStatusColor
}
and in info.plist I did this:-
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
Can u guys tell me any way so I can write these lines of code only two places and I can achieve my requirements.