Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift: How to draw UIs in Playground?

Tags:

xcode

swift

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.

like image 725
mengto Avatar asked Jun 03 '14 06:06

mengto


People also ask

Is Swift Playgrounds a good way to learn to code?

A computer is a thing you use to write apps. If you're an adult who wants to learn to code, don't let the kid-friendly nature of Swift Playgrounds dissuade you. It quickly becomes sophisticated enough to make it a worthwhile and satisfying way to learn about core programming concepts.

How do I use Xcode playground?

To open Playground on Xcode, navigate to File in the menu and click on New > Playground... To test our square function, we will choose the Blank template. Name your Playground file, then click on Create.


1 Answers

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.

like image 176
rickster Avatar answered Nov 15 '22 20:11

rickster