如何在 Xcode 中关闭颜色文字? [英] How to turn off color literals in Xcode?

查看:29
本文介绍了如何在 Xcode 中关闭颜色文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Swift 颜色文字编辑源文件时,Xcode 会显示一个填充颜色的正方形:

When editing a source file with a Swift color literal, Xcode shows a square filled with the color:

如果我更喜欢看到文字的原始文本表示;即

If I prefer to see the raw text representation of the literal; i.e.

textColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)

有没有办法让 Xcode 显示文本表示?我找不到控制它的 Xcode 编辑器设置.

is there a way to have Xcode display the text representation instead? I can't find an Xcode editor setting that controls this.

推荐答案

我怀疑是否有设置.

这与其说是解决方案,不如说是一种变通方法:

This is more a workaround than a solution:

⌘C 颜色方块 - 复制文本 - 并将其粘贴为评论

⌘C the color square – which copies the text –  and paste it as comment

这篇关于如何在 Xcode 中关闭颜色文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆