如何在xcode代码中显示图像标题而不是图标?

tfc*_*amp 5 xcode icons image ios swift

[在这里输入图像描述] [1]我正在写一个非常简单的线,但是我很难看到我实际写的是什么,因为我的图像标题在xcode中显示为一个图标.

我希望看到它:

thing.image = picture.png
Run Code Online (Sandbox Code Playgroud)

但我认为它是:

thing.image = an actual icon is here in the code for some weird purpose I can't understand
Run Code Online (Sandbox Code Playgroud)

我搜索没有运气.任何帮助是极大的赞赏.谢谢!

**编辑:我假设它是一个图标占位符...它显示为一个小白框.

**编辑:这是我的代码看起来如何:https: //i.stack.imgur.com/BGYvb.png

Gra*_*rks 6

相关:我喜欢文字; 事后找出图像的名称,让Xcode通过选择文字显示图像资源的名称,然后按Cmd-E"使用选择查找".图像的名称将显示在查找栏中,例如#imageLiteral(resourceName: "icn_spinner")

或者,按Cmd-/以评论该线路; 评论表单包含文字文本.


Gan*_*kam 4

将图像分配给 UIImageView

thing.image = UIImage(named:"picture.png")
Run Code Online (Sandbox Code Playgroud)