UIView's color cannot be changed programmatically after setting named color

Super interesting and you are correct it does not change the color value as expected. There must be some delay as to when IB attributes are set in the super class. Wrapping the color change in DispatchQueue.main.async makes it work in viewDidLoad. Probably because this code would be processed last after whatever the super class is doing with IB attributes. Hope this solves the issue.

DispatchQueue.main.async {
   self.view.backgroundColor = UIColor.blue
}

Also in viewDidLayoutSubviews and viewDidAppear it works without the DispatchQueue but has the same behavior as viewDidLoad in viewWillAppear of not working as expected.