Sobes.tech
Junior — Senior

What color will the layer have when outputted

livecode

Task condition

In the example, a UIView object is created, its background is set to red, and then the background color of the associated CALayer is set to another color – green. It is required to determine which color space object will be output when printing the backgroundColor property of the layer.

let container = UIView()
container.backgroundColor = .red

let backingLayer = container.layer
backingLayer.backgroundColor = UIColor.green.cgColor

print(container.layer.backgroundColor?.colorSpace as Any) // ?