swiftuitableviewuicolorcgcolor

How to convert Color Literal to cgColor in the Swift?


var CodeBackground = #colorLiteral(red: 0.1294117647, green: 0.1294117647, blue: 0.1960784314, alpha: 1)

cells?.layer.borderColor = //... how can i set this color literal to cgColor?

As I know how to convert that UIColor to cgColor in the Swift

as example

UIColor.black.cgColor

Bingo, but what about Color Literal to cgColor in the Swift

Thank you.


Solution

  • HOPE IT HELPS