-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change status bar style with theme #14
Comments
The property But you still can do the binding manually: themeService.typeStream
.map { $0 == .dark ? UIStatusBarStyle.lightContent : UIStatusBarStyle.default }
.bind { val in UIApplication.shared.statusBarStyle = val }
.disposed(by: disposeBag) Since Apple encourages developers to set status bar color per |
The would definitely be great. To have that option to set it to each ViewController. I'll try to do that now. Thank you! |
Tried your method and that does not work as most of my VCs are inside a navigationController. I developed an extension to be able to set the UITabBar.unselectedItemTintColor, and when I do this, it resets my other customizations. Like for example I am setting the color of the UITabBarItem Title to clear so I only see the icon, and when the theme switches, it replaces my clear color to the unselectedBarItemColor. |
What reactive extension does is only run a block of code you predefined when event happens. |
It seems that the reactive extension is returning a NEW tabBarItem, clearing my previous customization. I will look deeper into it to see where it's going wrong. |
Since class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
themeService.typeStream
.bind { [unowned self] val in
self.setNeedsStatusBarAppearanceUpdate()
}
.disposed(by: disposeBag)
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return themeService.type == .light ? .default : .lightContent
}
} |
If you are looking for a solution for |
After investigation, I noticed |
Is there any way to update the Status Bar Style as well when themeService.switch happens?
The text was updated successfully, but these errors were encountered: