Swift:如何在Playground中绘制UI?

时间:2021-08-08 11:50:16

How to draw UIs (Rectangle, Buttons, Views, etc) and view the results in real-time, as shown here: https://devimages.apple.com.edgekey.net/swift/images/swift-screenshot.jpg ? All I can see is the Console Output, but I can't find the option to show the visual display (Balloons) and the chart.

如何绘制UI(矩形,按钮,视图等)并实时查看结果,如下所示:https://devimages.apple.com.edgekey.net/swift/images/swift-screenshot.jpg?我只能看到控制台输出,但我找不到显示视觉显示(气球)和图表的选项。

1 个解决方案

#1


7  

Charts appear in the Assistant editor when you have something like a for loop, or for anything where you press the quick look or circle/plus buttons when mousing over the results area. See Viewing Results of an Executed Statement in Playground Help.

当您有类似for循环的内容时,或者在鼠标悬停在结果区域上时按下快速查看或圆圈/加号按钮的任何内容时,图表会显示在“助手”编辑器中。请参阅在“操作员帮助”中查看已执行语句的结果。

#1


7  

Charts appear in the Assistant editor when you have something like a for loop, or for anything where you press the quick look or circle/plus buttons when mousing over the results area. See Viewing Results of an Executed Statement in Playground Help.

当您有类似for循环的内容时,或者在鼠标悬停在结果区域上时按下快速查看或圆圈/加号按钮的任何内容时,图表会显示在“助手”编辑器中。请参阅在“操作员帮助”中查看已执行语句的结果。