I'm using Swift 5.1 and Xcode 11.1 and I've currently finished implementing Dark Mode design.
Theme updates immediately after user changes theme style in settings page with this code.
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else {
return
}
appDelegate.changeTheme(themeVal)
// App Delegate File
...
func changeTheme(themeVal: String) {
if #available(iOS 13.0, *) {
switch AppState.appThemeStyle {
case "dark":
window?.overrideUserInterfaceStyle = .dark
break
case "light":
window?.overrideUserInterfaceStyle = .light
break
default:
window?.overrideUserInterfaceStyle = .unspecified
}
}
}
But the problem is that I can't see status bar text because status bar text color and view color is same.
Could anyone please suggest me good solution? Thanks.