如何通过放置实际颜色来分配颜色

时间:2018-10-26 13:41:39

标签: ios swift xcode

我已经看到了通过一种表情符号样式添加颜色的示例(请参见附件的图像)。

在哪里可以找到颜色列表并将其直接添加到代码中?

enter image description here

2 个答案:

答案 0 :(得分:1)

开始将其键入为Color Literal,然后选择它作为自动完成建议,然后将为您提供颜色选项。

navigateButton.backgroundColor = Color L... // select Color Literal in auto-complete

答案 1 :(得分:1)

您可以通过编写Color Literal轻松获得它。

我还可以补充一点,您可以为图像键入Image literal