Using a named background color in Xcode breaks the ability to override the colour in viewDidLoad
Originator: | claus.junker.joergensen | ||
Number: | rdar://51208444 | Date Originated: | 2018-05-29 |
Status: | Open | Resolved: | |
Product: | Xcode | Product Version: | 10.2.1 |
Classification: | Bug | Reproducible: | Always |
Area: UIKit Summary: When setting a background color of the view of a ViewController in a Storyboard using a named color from a xcasset color set, it's no longer possible to override the colour in viewDidLoad / viewWillAppear Steps to Reproduce: 1. Create a color set in the xcassets file 2. Use the named color as the background color for a view in a storyboard 3. Attempt to override the color with another color in viewDidLoad Expected Results: Color should be overwritten Actual Results: Call to `view.backgroundColor = UIColor.orange` is ignored. Version/Build: Xcode Version 10.2.1 (10E1001) Swift 5.0
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Workaround
As a workaround, use
viewDidLayoutSubviews
to override the colour.