There seems to be a glitch on iOS 13 when trying to change the status bar color from one view controller to the other. The previous view controller overrides the preferred status bar style to light content. When navigating to a child view, I call the following code to set the status bar based on the interface style.
override var preferredStatusBarStyle: UIStatusBarStyle {
if #available(iOS 13, *) {
if self.traitCollection.userInterfaceStyle == .dark {
return .darkContent
} else {
return .lightContent
}
}
return .default
}
The status bar looks like so, where half of it is light and the time is dark (as it should be). After an arbitrary amount of time the status bar will draw properly. Ive tried calling setNeedsStatusBarDisplay(). Which does get called but does not fix the problem after a re-render. This only happens on iOS 13. Tested across multiple devices
Status bar glitch. Time is light where as battery and network icons are dark:
Thanks in advance!