Post

Replies

Boosts

Views

Activity

Reply to Background color not set in iOS 12
The reason I didn't post it to begin with is I doubt it matters, as it's straight up the one way to do it, but sure: override func viewDidLoad() {     super.viewDidLoad() 		myView.backgroundColor = UIColor(named: myColorB) } Line 3 overrides myColorA which is set in IB, but only in iOS 13, not iOS 12. For iOS 12 this code must be in viewWillLayoutSubviews() (or later, I guess would work as well)
Jun ’20
Reply to Background color not set in iOS 12
Both the colors in IB and the one I set via code are custom colors but are universal - no dark mode value. Also, if the issue is with iOS 12 not supporting dark mode, why does moving it to layoutSubviews fix it? Testing with setting IB to custom color and via code to a regular color in viewDidLoad: same issue Testing with setting IB to a regular color, and then my custom color in code: fixes it! I still think this is a bug to some degree, because my colors don't have dark mode values, but this is definitely good to know! Thank you I hope someone from Apple will chip in...
Jun ’20