Learn Courses My Dashboard

Color Literal not working in Xcode 14

Hi, I am trying to use color literal and it seems that is not working in Xcode 14.

Can anyone help me?


If you are trying to use it in SwiftUI you will run into all sorts of issue since it is a UIColor as opposed to a Color.

To get a color literal to work you have to type:

In SwiftUI you can do this:

Screen Shot 2023-01-19 at 09.09.13

and then use that in a View like this:


1 Like