Howdy!
I am running into a probem where changing the backgroundColor of an active UIView is sometimes not reflected in the simulator. When this happens, I've been able to confirm via the debugger that the backgroundColor property is being set, but the color that is rendered is not changing! Basically view.backgroundColor could be equal to UIColor.black, but the rendered color remains gray. Can anyone help explain what could possibly be going wrong?
Not sure if important, but I have an extreemly simple UIViewController consisting of a single UIView that looks roughly like the following.
final class ViewController: UIViewController, Themeable {
override func viewDidLoad() {
super.viewDidLoad()
// basically sets up calls to update(theme:) when UITraitCollection.current changes
subscribeToThemePublisher()
}
// from Themeable
func update(theme: any Theme) {
guard isViewLoaded else {
return
}
view.backgroundColor = theme.backgroundColor
}
}