Im trying to set an attribute with a specific color, in this case I want to use the Color Literal function however Xcode is not suggesting Color Literal and only giving me the options to pick from UIColor... How can I fix the suggestions issue?
I think you can add this literal to your code snippet library.
#colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
This is possibly because the compiler does not know that you want a color. You are putting it into a dictionary and all you have told it is that it is of type Any
.
Try creating the color first...
let color: UIColor = ColorLiteral
That should then pop up the picker. And you can put color
into your dictionary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With